mirror of
https://github.com/docmost/docmost.git
synced 2026-07-12 03:34:52 +10:00
feat(bases): allow updateRow to set position atomically
This commit is contained in:
@@ -275,6 +275,7 @@ export class BaseRowRepo {
|
||||
pageId: string;
|
||||
workspaceId: string;
|
||||
actorId?: string;
|
||||
position?: string;
|
||||
trx?: KyselyTransaction;
|
||||
},
|
||||
): Promise<BaseRow | undefined> {
|
||||
@@ -287,6 +288,7 @@ export class BaseRowRepo {
|
||||
.updateTable('baseRows')
|
||||
.set({
|
||||
cells: sql`jsonb_set_many(cells, ${patchJson}::text::jsonb)`,
|
||||
...(opts.position !== undefined && { position: opts.position }),
|
||||
updatedAt: new Date(),
|
||||
lastUpdatedById: opts.actorId ?? null,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user