more work on the note endpoint, for now im going to work around it

This commit is contained in:
Ben
2018-09-24 14:05:47 +01:00
parent d72127bf2b
commit bff3461278
3 changed files with 12 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ export class NoteController extends ControllerHandler {
let content = req.body.text || null;
let creatorid = req.user.id || undefined;
let group = req.body.parentgroup || undefined;
let group = req.body.parentgroup || null;
let order = req.body.order || undefined;
let user = req.user || undefined;
@@ -23,13 +23,16 @@ export class NoteController extends ControllerHandler {
return;
}
if (!order) {
errors.addError(422, 'Unprocessable entity');
errors.endpoint();
next();
return;
}
if (!group) group == 0;
let id = await Notes.genID();
// what the hecking heck is this code supoased to do you hecking idiot
Notes.newNote(id, content, creatorid, order);
next();
}