Added Update Article.
This commit is contained in:
@ -46,9 +46,9 @@ module.exports = class GetBlogArticle extends APIHandler {
|
||||
|
||||
async handle(request) {
|
||||
//Until we have the server running passport or some other auth service...
|
||||
if(!request.hasString('password', 128)) return { ok: false, data: ERRORS.password };
|
||||
if(!request.hasString('password', 128)) return { ok: 401, data: ERRORS.password };
|
||||
let password = request.getString('password', 128);
|
||||
if(password !== request.getApp().getConfig().get('admin.password')) return { ok: false, data: ERRORS.password };
|
||||
if(password !== request.getApp().getConfig().get('admin.password')) return { ok: 401, data: ERRORS.password };
|
||||
//Everything after this point should be fine to keep.
|
||||
|
||||
if(!request.hasString('title', LENGTHS.title)) return { ok: false, data: ERRORS.title };
|
||||
@ -81,6 +81,6 @@ module.exports = class GetBlogArticle extends APIHandler {
|
||||
return { ok: 500, data: ERRORS.internal };
|
||||
}
|
||||
|
||||
return { ok: true, data: article };
|
||||
return { ok: 201, data: article };
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user