@@ -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 ` ,
0 commit comments