feature: rooms and events implemented on the backend
This commit is contained in:
parent
df00324e24
commit
85024c6e62
29 changed files with 1659 additions and 115 deletions
|
@ -1,13 +1,41 @@
|
|||
export const CANNED_RESPONSES: Record<string, () => Response> = {
|
||||
permission_denied: (): Response => {
|
||||
console.trace('denied');
|
||||
return Response.json({
|
||||
error: {
|
||||
message: 'Permission denied.',
|
||||
cause: 'permission_denied'
|
||||
}
|
||||
}, {
|
||||
status: 400
|
||||
});
|
||||
export function not_found(): Response {
|
||||
if (Deno.env.get('TRACE_ERROR_RESPONSES')) {
|
||||
console.trace('not_found');
|
||||
}
|
||||
};
|
||||
return Response.json({
|
||||
error: {
|
||||
message: 'Not found.',
|
||||
cause: 'not_found'
|
||||
}
|
||||
}, {
|
||||
status: 404
|
||||
});
|
||||
}
|
||||
|
||||
export function permission_denied(): Response {
|
||||
if (Deno.env.get('TRACE_ERROR_RESPONSES')) {
|
||||
console.trace('permission_denied');
|
||||
}
|
||||
return Response.json({
|
||||
error: {
|
||||
message: 'Permission denied.',
|
||||
cause: 'permission_denied'
|
||||
}
|
||||
}, {
|
||||
status: 400
|
||||
});
|
||||
}
|
||||
|
||||
export function append_only_events(): Response {
|
||||
if (Deno.env.get('TRACE_ERROR_RESPONSES')) {
|
||||
console.trace('append_only_events');
|
||||
}
|
||||
return Response.json({
|
||||
error: {
|
||||
message: 'This server does not allow modifying events.',
|
||||
cause: 'append_only_events'
|
||||
}
|
||||
}, {
|
||||
status: 400
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue