Skip to content

Commit 8cdbfc5

Browse files
committed
fix: remove obsolete documentsDB log endpoints, use tablesDB equivalents
1 parent 23f820b commit 8cdbfc5

File tree

2 files changed

+11
-24
lines changed
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]

2 files changed

+11
-24
lines changed

src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/views/field/activity.svelte

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { pageToOffset } from '$lib/helpers/load';
77
import { Skeleton } from '@appwrite.io/pink-svelte';
88
import { type Models, Query } from '@appwrite.io/console';
9-
import { getTerminologies, type Record, toSupportiveRecord } from '$database/(entity)';
9+
import { type Record, toSupportiveRecord } from '$database/(entity)';
1010
1111
const {
1212
record
@@ -19,8 +19,6 @@
1919
let loading = $state(true);
2020
let recordActivityLogs = $state<Models.LogList | null>(null);
2121
22-
const { terminology } = getTerminologies();
23-
2422
onMount(loadRecordLogs);
2523
2624
async function loadRecordLogs(event?: CustomEvent<number>) {
@@ -32,25 +30,14 @@
3230
3331
const { $databaseId: databaseId, entityId, $id: recordId } = toSupportiveRecord(record);
3432
35-
if (terminology.type === 'documentsdb') {
36-
recordActivityLogs = await sdk
37-
.forProject(page.params.region, page.params.project)
38-
.documentsDB.listDocumentLogs({
39-
databaseId: databaseId,
40-
collectionId: entityId,
41-
documentId: recordId,
42-
queries: [Query.limit(limit), Query.offset(offset)]
43-
});
44-
} else {
45-
recordActivityLogs = await sdk
46-
.forProject(page.params.region, page.params.project)
47-
.tablesDB.listRowLogs({
48-
databaseId: databaseId,
49-
tableId: entityId,
50-
rowId: recordId,
51-
queries: [Query.limit(limit), Query.offset(offset)]
52-
});
53-
}
33+
recordActivityLogs = await sdk
34+
.forProject(page.params.region, page.params.project)
35+
.tablesDB.listRowLogs({
36+
databaseId: databaseId,
37+
tableId: entityId,
38+
rowId: recordId,
39+
queries: [Query.limit(limit), Query.offset(offset)]
40+
});
5441
5542
loading = false;
5643
}

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/activity/+page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export const load: PageLoad = async ({ params, url, route }) => {
1212
return {
1313
offset,
1414
limit,
15-
logs: await sdk.forProject(params.region, params.project).documentsDB.listCollectionLogs({
15+
logs: await sdk.forProject(params.region, params.project).tablesDB.listTableLogs({
1616
databaseId: params.database,
17-
collectionId: params.collection,
17+
tableId: params.collection,
1818
queries: [Query.limit(limit), Query.offset(offset)]
1919
})
2020
};

0 commit comments

Comments
 (0)