From f2036ae0ede4c320a27f366825f5d162736ce1e5 Mon Sep 17 00:00:00 2001 From: karn Date: Sun, 22 Dec 2024 05:13:17 +0530 Subject: [PATCH] fix any breaking changs --- routers/models/note.go | 8 ++++---- ui/components/notes-list/index.tsx | 4 ++-- ui/libs/utils/note.tsx | 4 ++-- ui/queries/services/note-service.ts | 7 ++++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/routers/models/note.go b/routers/models/note.go index c8c4436..9b54e71 100644 --- a/routers/models/note.go +++ b/routers/models/note.go @@ -26,8 +26,8 @@ type Note struct { Created int64 `json:"created"` Updated int64 `json:"updated"` WorkspaceID int64 `json:"workspaceId"` - CreatedBy int64 `json:"createdById"` - UpdatedBy int64 `json:"updatedById"` + CreatedByID int64 `json:"createdById"` + UpdatedByID int64 `json:"updatedById"` } func ModelForNote(note *notes.Note) (*Note, error) { @@ -56,7 +56,7 @@ func ModelForNote(note *notes.Note) (*Note, error) { Created: note.Created, Updated: note.Updated, WorkspaceID: note.WorkspaceID, - CreatedBy: note.CreatedByID, - UpdatedBy: note.UpdatedByID, + CreatedByID: note.CreatedByID, + UpdatedByID: note.UpdatedByID, }, nil } diff --git a/ui/components/notes-list/index.tsx b/ui/components/notes-list/index.tsx index bcd153a..9433622 100644 --- a/ui/components/notes-list/index.tsx +++ b/ui/components/notes-list/index.tsx @@ -18,8 +18,8 @@ import { Button } from '../ui/button' import NotesListBatchSelectActions from './batch-select-actions' const SortOptions = [ - { value: '-created', label: 'last created' }, - { value: '-updated', label: 'last modified' }, + { value: 'created_dsc', label: 'last created' }, + { value: 'updated_dsc', label: 'last modified' }, ] const yesterdayStart = dayjs().subtract(1, 'day').startOf('day').unix() diff --git a/ui/libs/utils/note.tsx b/ui/libs/utils/note.tsx index 1d8b3da..8fd92a5 100644 --- a/ui/libs/utils/note.tsx +++ b/ui/libs/utils/note.tsx @@ -40,8 +40,8 @@ export const defaultNewNote = ( }, created: nowInSeconds, updated: nowInSeconds, - createdBy: user, - updatedBy: user, + createdById: user.id, + updatedById: user.id, hasAudios: false, hasClosedTasks: false, hasCode: false, diff --git a/ui/queries/services/note-service.ts b/ui/queries/services/note-service.ts index a62cf46..2cd3234 100644 --- a/ui/queries/services/note-service.ts +++ b/ui/queries/services/note-service.ts @@ -14,8 +14,8 @@ export interface Note { trashed: boolean created: number updated: number - createdBy: User - updatedBy: User + createdById: number + updatedById: number workspaceId: number hasAudios: boolean hasClosedTasks: boolean @@ -38,6 +38,7 @@ export interface NoteResponse { export interface ListNotesResponse { notes: Note[] + authors: User[] nextCursor: string } @@ -90,7 +91,7 @@ export const deleteNoteMulti = async ({ export const fetchAllNotes = async ({ workspaceId, cursor = '', - sort = '-updated', + sort = 'updated_dsc', limit = 100, }: { workspaceId: number