mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Handle website delete. Added response helper functions.
This commit is contained in:
parent
0a411a9ad6
commit
c4b75e4aec
31 changed files with 314 additions and 96 deletions
25
lib/response.js
Normal file
25
lib/response.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
export function ok(res, data = {}) {
|
||||
return res.status(200).json(data);
|
||||
}
|
||||
|
||||
export function redirect(res, url) {
|
||||
res.setHeader('Location', url);
|
||||
|
||||
return res.status(303).end();
|
||||
}
|
||||
|
||||
export function badRequest(res) {
|
||||
return res.status(400).end();
|
||||
}
|
||||
|
||||
export function unauthorized(res) {
|
||||
return res.status(401).end();
|
||||
}
|
||||
|
||||
export function forbidden(res) {
|
||||
return res.status(403).end();
|
||||
}
|
||||
|
||||
export function methodNotAllowed(res) {
|
||||
res.status(405).end();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue