We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b892d61 commit cc4d201Copy full SHA for cc4d201
packages/backend/src/apps/aisay/common/schema.ts
@@ -5,10 +5,18 @@ import { parseS3Id } from '@/helpers/s3'
5
import { DOCUMENT_TYPES } from './constants'
6
7
export const fileSchema = z.string().transform((value, context) => {
8
+ if (!value) {
9
+ context.addIssue({
10
+ code: z.ZodIssueCode.custom,
11
+ message: 'No file was provided',
12
+ fatal: true,
13
+ })
14
+ return z.NEVER
15
+ }
16
if (!parseS3Id(value)) {
17
context.addIssue({
18
code: z.ZodIssueCode.custom,
- message: `No file was provided`,
19
+ message: `${value} is not a S3 ID.`,
20
fatal: true,
21
})
22
return z.NEVER
0 commit comments