New formatting
This commit is contained in:
@ -14,7 +14,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
if (
|
||||
!context.data.current_user?.permissions ||
|
||||
![1 << 0, 1 << 2, 1 << 11].find(
|
||||
(p) => context.data.current_user.permissions & p
|
||||
(p) => context.data.current_user.permissions & p,
|
||||
)
|
||||
)
|
||||
return new Response('{"error":"Forbidden"}', {
|
||||
@ -88,7 +88,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
});
|
||||
|
||||
const attachmentKey = `${Date.now()}${Math.round(
|
||||
Math.random() * 10000000
|
||||
Math.random() * 10000000,
|
||||
).toString()}/${file.name}`;
|
||||
|
||||
urlPromises.push(
|
||||
@ -96,8 +96,8 @@ export async function onRequestPost(context: RequestContext) {
|
||||
context.env,
|
||||
attachmentKey,
|
||||
file.size,
|
||||
(allowedFileTypes.find((t) => t === file.type) as string).split("/")[1]
|
||||
)
|
||||
(allowedFileTypes.find((t) => t === file.type) as string).split("/")[1],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -111,9 +111,9 @@ export async function onRequestPost(context: RequestContext) {
|
||||
status: 500,
|
||||
});
|
||||
|
||||
const infractionId = `${body.get("user")}${Date.now()}${
|
||||
context.request.headers.get("cf-ray")?.split("-")[0]
|
||||
}`;
|
||||
const infractionId = `${body.get(
|
||||
"user",
|
||||
)}${Date.now()}${context.request.headers.get("cf-ray")?.split("-")[0]}`;
|
||||
const uploadReqs = [];
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
@ -121,7 +121,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
fetch(settledURLPromises[i] as unknown as string, {
|
||||
body: files[i],
|
||||
method: "PUT",
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
JSON.stringify({
|
||||
created_at: Date.now(),
|
||||
moderator: context.data.current_user.id,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
return new Response(null, {
|
||||
|
Reference in New Issue
Block a user