mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
using 201 for created entities in etapi
This commit is contained in:
@@ -12,8 +12,8 @@ function register(router) {
|
||||
}
|
||||
|
||||
const {authToken} = etapiTokenService.createToken(tokenName || "ETAPI login");
|
||||
|
||||
res.json({
|
||||
|
||||
res.status(201).json({
|
||||
authToken
|
||||
});
|
||||
});
|
||||
@@ -26,18 +26,18 @@ function register(router) {
|
||||
}
|
||||
|
||||
const etapiToken = becca.getEtapiToken(parsed.etapiTokenId);
|
||||
|
||||
|
||||
if (!etapiToken) {
|
||||
// shouldn't happen since this already passed auth validation
|
||||
throw new Error(`Cannot find the token ${parsed.etapiTokenId}.`);
|
||||
}
|
||||
|
||||
|
||||
etapiToken.markAsDeletedSimple();
|
||||
|
||||
|
||||
res.sendStatus(204);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
register
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user