basic file sharing
This commit is contained in:
12
frontend/lib/schemas/share.ts
Normal file
12
frontend/lib/schemas/share.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { number, object, string } from 'yup';
|
||||
|
||||
export const shareSchema = object({
|
||||
password: string()
|
||||
.trim()
|
||||
.transform((s: string) => (s.length > 0 ? s : undefined))
|
||||
.optional(),
|
||||
lifetime: number()
|
||||
.positive()
|
||||
.transform((n) => (isNaN(n) ? undefined : n))
|
||||
.optional(),
|
||||
});
|
||||
Reference in New Issue
Block a user