File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ const router = useRouter();
103103const record = ref ({});
104104
105105const coreStore = useCoreStore ();
106- const { runSaveInterceptors } = useAdminforth ();
106+ const { api } = useAdminforth ();
107107
108108const { t } = useI18n ();
109109
@@ -119,8 +119,7 @@ async function onUpdateRecord(newRecord: any) {
119119}
120120
121121onBeforeMount (() => {
122- const { clearSaveInterceptors } = useAdminforth ();
123- clearSaveInterceptors (route .params .resourceId as string );
122+ api .clearSaveInterceptors (route .params .resourceId as string );
124123});
125124
126125onMounted (async () => {
@@ -175,7 +174,7 @@ async function saveRecord() {
175174 const requiredColumns = coreStore .resource ?.columns .filter (c => c .required ?.create === true ) || [];
176175 const requiredColumnsToSkip = requiredColumns .filter (c => checkShowIf (c , record .value , coreStore .resource ?.columns || []) === false );
177176 saving .value = true ;
178- const interceptorsResult = await runSaveInterceptors ({
177+ const interceptorsResult = await api . runSaveInterceptors ({
179178 action: ' create' ,
180179 values: record .value ,
181180 resource: coreStore .resource ,
@@ -186,7 +185,7 @@ async function saveRecord() {
186185 if (interceptorsResult .error ) showErrorTost (interceptorsResult .error );
187186 return ;
188187 }
189- const interceptorConfirmationResult = interceptorsResult .extra ?.confirmationResult ;
188+ const interceptorConfirmationResult = ( interceptorsResult .extra as Record < string , any >) ?.confirmationResult ;
190189 const response = await callAdminForthApi ({
191190 method: ' POST' ,
192191 path: ` /create_record ` ,
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ import type { AdminForthResourceColumn } from '@/types/Back';
8787
8888const { t } = useI18n ();
8989const coreStore = useCoreStore ();
90- const { runSaveInterceptors } = useAdminforth ();
90+ const { api } = useAdminforth ();
9191
9292const isValid = ref (false );
9393const validating = ref (false );
@@ -129,8 +129,7 @@ const editableRecord = computed(() => {
129129})
130130
131131onBeforeMount (() => {
132- const { clearSaveInterceptors } = useAdminforth ();
133- clearSaveInterceptors (route .params .resourceId as string );
132+ api .clearSaveInterceptors (route .params .resourceId as string );
134133});
135134
136135onMounted (async () => {
@@ -165,7 +164,7 @@ async function saveRecord() {
165164 }
166165
167166 saving .value = true ;
168- const interceptorsResult = await runSaveInterceptors ({
167+ const interceptorsResult = await api . runSaveInterceptors ({
169168 action: ' edit' ,
170169 values: record .value ,
171170 resource: coreStore .resource ,
You can’t perform that action at this time.
0 commit comments