massive state refactor, mostly fixes #3

This commit is contained in:
Michael Dausmann
2023-04-12 00:05:32 +10:00
parent 4d288c7468
commit 028a7dda45
11 changed files with 160 additions and 171 deletions

View File

@@ -4,10 +4,9 @@ import { z } from 'zod';
export const notesRouter = router({
getForCurrentUser: protectedProcedure
.input(z.object({ account_id: z.number() }))
.query(async ({ ctx, input }) => {
const notesService = new NotesService();
const notes = await notesService.getNotesForAccountId(input.account_id);
const notes = (ctx.activeAccountId)?await notesService.getNotesForAccountId(ctx.activeAccountId):[];
return {
notes,
}