Skip to content

Commit 2c8a2be

Browse files
committed
fix: use admin resource client to prepare update statement for apartments
1 parent b5ccf42 commit 2c8a2be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dev-demo/resources/apartments.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import TextCompletePlugin from "../../plugins/adminforth-text-complete";
99
import UploadPlugin from "../../plugins/adminforth-upload";
1010
import ImportExportPlugin from "../../plugins/adminforth-import-export/index.js";
1111
import { v1 as uuid } from "uuid";
12+
import { admin } from '../index.js';
1213
import RichEditorPlugin from "../../plugins/adminforth-rich-editor";
1314
import { AdminForthResourceInput } from "../../adminforth";
1415
import CompletionAdapterOpenAIChatGPT from "../../adapters/adminforth-completion-adapter-open-ai-chat-gpt/index.js";
@@ -388,7 +389,7 @@ export default {
388389
confirm:
389390
"Are you sure you want to mark all selected apartments as listed?",
390391
action: async function ({ selectedIds, adminUser }: any) {
391-
const stmt = db.prepare(
392+
const stmt = admin.resource('aparts').dataConnector.client.prepare(
392393
`UPDATE apartments SET listed = 1 WHERE id IN (${selectedIds
393394
.map(() => "?")
394395
.join(",")})`

0 commit comments

Comments
 (0)