Skip to content

Commit 93a6b4f

Browse files
committed
chore: simplify imports and improve error handling in image generation component
1 parent 581e63e commit 93a6b4f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

custom/imageGenerationCarousel.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183

184184
<script setup lang="ts">
185185
186-
import { ref, onMounted, nextTick, Ref, h, computed, watch, reactive } from 'vue'
186+
import { ref, onMounted, nextTick, Ref, watch } from 'vue'
187187
import { Carousel } from 'flowbite';
188188
import { callAdminForthApi } from '@/utils';
189189
import { useI18n } from 'vue-i18n';
@@ -267,9 +267,8 @@ onMounted(async () => {
267267
return context[field.trim()] || '';
268268
});
269269
270-
if (props.record[props.record[props.meta.recorPkFieldName]]) {
271270
const recordId = props.record[props.meta.recorPkFieldName];
272-
} else {
271+
if (!recordId) {
273272
emit('error', {
274273
isError: true,
275274
errorMessage: 'Record ID not found, cannot generate images'

index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { AdminForthPlugin, Filters } from "adminforth";
2-
import type { IAdminForth, IHttpServer, AdminForthComponentDeclaration, AdminForthResourceColumn, AdminForthDataTypes, AdminForthResource } from "adminforth";
2+
import type { IAdminForth, IHttpServer, AdminForthComponentDeclaration, AdminForthResource } from "adminforth";
33
import type { PluginOptions } from './types.js';
4-
import { json } from "stream/consumers";
5-
import Handlebars, { compile } from 'handlebars';
4+
import Handlebars from 'handlebars';
65
import { RateLimiter } from "adminforth";
76

87

0 commit comments

Comments
 (0)