@@ -35,8 +35,14 @@ export const reorderFolderSchema = z.object({
3535} ) ;
3636
3737export const createNoteSchema = z . object ( {
38- title : z . string ( ) . min ( 1 ) . max ( 200 ) . optional ( ) ,
39- content : z . string ( ) . optional ( ) ,
38+ title : z . string ( ) . refine (
39+ ( value ) => value === "[ENCRYPTED]" ,
40+ "Title must be '[ENCRYPTED]'"
41+ ) . optional ( ) ,
42+ content : z . string ( ) . refine (
43+ ( value ) => value === "[ENCRYPTED]" ,
44+ "Content must be '[ENCRYPTED]'"
45+ ) . optional ( ) ,
4046 folderId : z . string ( ) . uuid ( ) . nullable ( ) . optional ( ) ,
4147 starred : z . boolean ( ) . optional ( ) ,
4248 tags : z . array ( z . string ( ) . max ( 50 ) ) . max ( 20 ) . optional ( ) ,
@@ -48,8 +54,14 @@ export const createNoteSchema = z.object({
4854} ) ;
4955
5056export const updateNoteSchema = z . object ( {
51- title : z . string ( ) . min ( 1 ) . max ( 200 ) . optional ( ) ,
52- content : z . string ( ) . optional ( ) ,
57+ title : z . string ( ) . refine (
58+ ( value ) => value === "[ENCRYPTED]" ,
59+ "Title must be '[ENCRYPTED]'"
60+ ) . optional ( ) ,
61+ content : z . string ( ) . refine (
62+ ( value ) => value === "[ENCRYPTED]" ,
63+ "Content must be '[ENCRYPTED]'"
64+ ) . optional ( ) ,
5365 folderId : z . string ( ) . uuid ( ) . nullable ( ) . optional ( ) ,
5466 starred : z . boolean ( ) . optional ( ) ,
5567 archived : z . boolean ( ) . optional ( ) ,
0 commit comments