Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Add missing await to ModelsController #20

Merged
merged 1 commit into from
Jul 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/controllers/ModelsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const makeModelsController = (
const ModelsController = addAsync(express.Router());
ModelsController.use(bodyParser.json());

ModelsController.post('/crawl', async (req, res) => {
ModelsController.postAsync('/crawl', async (req, res) => {
const { gaiaURL } = req.body;
const attrs = await request({
uri: gaiaURL,
json: true,
});
const validator = new Validator(radiksCollection, attrs);
try {
validator.validate();
await validator.validate();
await radiksCollection.save(attrs);
emitter.emit(constants.STREAM_CRAWL_EVENT, [attrs]);

Expand Down