ditch useState and composables in favour of pinia store - add server rendered note detail page

This commit is contained in:
Michael Dausmann
2023-02-19 01:22:55 +11:00
parent bb9f4dfd1d
commit b3ee03b5c3
10 changed files with 325 additions and 539 deletions

View File

@@ -11,6 +11,10 @@ export default class NotesService {
return this.prisma.note.findMany();
}
async getNoteById(id: number) {
return this.prisma.note.findUniqueOrThrow({ where: { id } });
}
async getNotesForAccountId(account_id: number) {
return this.prisma.note.findMany({ where: { account_id } });
}