mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
Make status creation API more permissive
This commit is contained in:
parent
4cee92f22d
commit
325ecbfc53
|
|
@ -98,8 +98,6 @@ export class RequestParser {
|
|||
const formData = await this.request.formData();
|
||||
const result: Partial<T> = {};
|
||||
|
||||
console.log([...formData.entries()]);
|
||||
|
||||
for (const [key, value] of formData.entries()) {
|
||||
if (value instanceof Blob) {
|
||||
result[key as keyof T] = value as T[keyof T];
|
||||
|
|
|
|||
|
|
@ -133,8 +133,6 @@ export const processRoute = async (
|
|||
return null;
|
||||
});
|
||||
|
||||
console.log(parsedRequest);
|
||||
|
||||
if (!parsedRequest) {
|
||||
return errorResponse(
|
||||
"The request could not be parsed, it may be malformed",
|
||||
|
|
|
|||
|
|
@ -50,13 +50,13 @@ export const schema = z.object({
|
|||
.optional(),
|
||||
"poll[multiple]": z.boolean().optional(),
|
||||
"poll[hide_totals]": z.boolean().optional(),
|
||||
in_reply_to_id: z.string().regex(idValidator).optional(),
|
||||
quote_id: z.string().regex(idValidator).optional(),
|
||||
in_reply_to_id: z.string().regex(idValidator).optional().nullable(),
|
||||
quote_id: z.string().regex(idValidator).optional().nullable(),
|
||||
visibility: z
|
||||
.enum(["public", "unlisted", "private", "direct"])
|
||||
.optional()
|
||||
.default("public"),
|
||||
scheduled_at: z.string().optional(),
|
||||
scheduled_at: z.string().optional().nullable(),
|
||||
local_only: z.boolean().optional(),
|
||||
federate: z.boolean().optional().default(true),
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue