forked from atums.world/backend
add s3 and local dir support, fix session roles, make sure delete invite checks if its valid first
This commit is contained in:
parent
9a91f1e7e3
commit
774c8e22ce
11 changed files with 171 additions and 12 deletions
|
@ -1,3 +1,4 @@
|
|||
import { isValidInvite } from "@config/sql/users";
|
||||
import { type ReservedSQL, sql } from "bun";
|
||||
|
||||
import { logger } from "@/helpers/logger";
|
||||
|
@ -34,6 +35,19 @@ async function handler(request: ExtendedRequest): Promise<Response> {
|
|||
);
|
||||
}
|
||||
|
||||
const { valid, error } = isValidInvite(invite);
|
||||
|
||||
if (!valid && error) {
|
||||
return Response.json(
|
||||
{
|
||||
success: false,
|
||||
code: 400,
|
||||
error: error,
|
||||
},
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
|
||||
const reservation: ReservedSQL = await sql.reserve();
|
||||
let inviteData: Invite | null = null;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue