bug fix
This commit is contained in:
parent
019790791b
commit
cbb7a666cd
|
@ -76,7 +76,7 @@ export default async function postLink(
|
||||||
let linkType = "url";
|
let linkType = "url";
|
||||||
let imageExtension = "png";
|
let imageExtension = "png";
|
||||||
|
|
||||||
if (!link.url) linkType = link.type;
|
if (!link.url) linkType = link.type || "url";
|
||||||
else if (contentType === "application/pdf") linkType = "pdf";
|
else if (contentType === "application/pdf") linkType = "pdf";
|
||||||
else if (contentType?.startsWith("image")) {
|
else if (contentType?.startsWith("image")) {
|
||||||
linkType = "image";
|
linkType = "image";
|
||||||
|
|
|
@ -92,7 +92,7 @@ export const PostSessionSchema = z.object({
|
||||||
});
|
});
|
||||||
|
|
||||||
export const PostLinkSchema = z.object({
|
export const PostLinkSchema = z.object({
|
||||||
type: z.enum(["url", "pdf", "image"]),
|
type: z.enum(["url", "pdf", "image"]).nullish(),
|
||||||
url: z.string().trim().max(2048).url().optional(),
|
url: z.string().trim().max(2048).url().optional(),
|
||||||
name: z.string().trim().max(2048).optional(),
|
name: z.string().trim().max(2048).optional(),
|
||||||
description: z.string().trim().max(2048).optional(),
|
description: z.string().trim().max(2048).optional(),
|
||||||
|
|
Ŝarĝante…
Reference in New Issue