mirror of
https://github.com/docmost/docmost.git
synced 2026-07-27 04:04:40 +10:00
refactor(base): update task files to use renamed repo methods
This commit is contained in:
@@ -31,7 +31,7 @@ export async function processBaseFormulaRecompute(
|
|||||||
},
|
},
|
||||||
): Promise<{ processed: number; errored: number }> {
|
): Promise<{ processed: number; errored: number }> {
|
||||||
const { baseId, workspaceId, propertyIds, rowIds } = data;
|
const { baseId, workspaceId, propertyIds, rowIds } = data;
|
||||||
const properties = await basePropertyRepo.findByBaseId(baseId);
|
const properties = await basePropertyRepo.findByPageId(baseId);
|
||||||
const targets = properties.filter(
|
const targets = properties.filter(
|
||||||
(p) => p.type === "formula" && propertyIds.includes(p.id),
|
(p) => p.type === "formula" && propertyIds.includes(p.id),
|
||||||
);
|
);
|
||||||
@@ -46,7 +46,7 @@ export async function processBaseFormulaRecompute(
|
|||||||
let processed = 0;
|
let processed = 0;
|
||||||
let errored = 0;
|
let errored = 0;
|
||||||
|
|
||||||
for await (const chunk of baseRowRepo.streamByBaseId(baseId, {
|
for await (const chunk of baseRowRepo.streamByPageId(baseId, {
|
||||||
workspaceId,
|
workspaceId,
|
||||||
chunkSize: CHUNK_SIZE,
|
chunkSize: CHUNK_SIZE,
|
||||||
trx: opts?.trx,
|
trx: opts?.trx,
|
||||||
@@ -90,7 +90,7 @@ export async function processBaseFormulaRecompute(
|
|||||||
// so passing actorId: undefined preserves last_updated_by_id while still
|
// so passing actorId: undefined preserves last_updated_by_id while still
|
||||||
// bumping updated_at — matches spec "only lastEditedAt moves".
|
// bumping updated_at — matches spec "only lastEditedAt moves".
|
||||||
await baseRowRepo.batchUpdateCells(updates, {
|
await baseRowRepo.batchUpdateCells(updates, {
|
||||||
baseId,
|
pageId: baseId,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
actorId: undefined,
|
actorId: undefined,
|
||||||
trx: opts?.trx,
|
trx: opts?.trx,
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export async function processBaseTypeConversion(
|
|||||||
// rewriting — everything else is already consistent with the new type
|
// rewriting — everything else is already consistent with the new type
|
||||||
// (empty value → empty value). Skips the full-table scan on bases
|
// (empty value → empty value). Skips the full-table scan on bases
|
||||||
// where the property was only ever set on a few rows.
|
// where the property was only ever set on a few rows.
|
||||||
for await (const chunk of baseRowRepo.streamByBaseId(baseId, {
|
for await (const chunk of baseRowRepo.streamByPageId(baseId, {
|
||||||
workspaceId,
|
workspaceId,
|
||||||
chunkSize: CHUNK_SIZE,
|
chunkSize: CHUNK_SIZE,
|
||||||
trx,
|
trx,
|
||||||
@@ -105,7 +105,7 @@ export async function processBaseTypeConversion(
|
|||||||
|
|
||||||
if (updates.length > 0) {
|
if (updates.length > 0) {
|
||||||
await baseRowRepo.batchUpdateCells(updates, {
|
await baseRowRepo.batchUpdateCells(updates, {
|
||||||
baseId,
|
pageId: baseId,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
actorId,
|
actorId,
|
||||||
trx,
|
trx,
|
||||||
|
|||||||
Reference in New Issue
Block a user