feat: Add notes with markdown editor #1
@@ -72,9 +72,33 @@ export const schema = S.Collections({
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
notes: {
|
||||
schema: S.Schema({
|
||||
id: S.Id(),
|
||||
userId: S.String(),
|
||||
title: S.String({ default: '' }),
|
||||
content: S.String({ default: '' }),
|
||||
pinned: S.Boolean({ default: false }),
|
||||
archived: S.Boolean({ default: false }),
|
||||
deleted: S.Boolean({ default: false }),
|
||||
tags: S.Set(S.String(), { default: [] }),
|
||||
createdAt: S.Date({ default: S.Default.now() }),
|
||||
updatedAt: S.Date({ default: S.Default.now() }),
|
||||
deletedAt: S.Date({ nullable: true }),
|
||||
}),
|
||||
permissions: {
|
||||
owner: {
|
||||
read: { filter: [['userId', '=', '$userId']] },
|
||||
insert: { filter: [['userId', '=', '$userId']] },
|
||||
update: { filter: [['userId', '=', '$userId']] },
|
||||
delete: { filter: [['userId', '=', '$userId']] }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Use the `Entity` type to extract clean types for your collections
|
||||
export type Habit = Entity<typeof schema, 'habits'>;
|
||||
export type HabitCompletion = Entity<typeof schema, 'habit_completions'>;
|
||||
export type HabitCompletion = Entity<typeof schema, 'habit_completions'>;
|
||||
export type Note = Entity<typeof schema, 'notes'>;
|
||||
Reference in New Issue
Block a user