diff --git a/frontend/components/Item/AttachmentsList.vue b/frontend/components/Item/AttachmentsList.vue index 1dd8855..ddad600 100644 --- a/frontend/components/Item/AttachmentsList.vue +++ b/frontend/components/Item/AttachmentsList.vue @@ -11,10 +11,10 @@
- + - +
@@ -37,11 +37,9 @@ const api = useUserApi(); - function attachmentURL(attachmentId : string) { + function attachmentURL(attachmentId: string) { return api.authURL(`/items/${props.itemId}/attachments/${attachmentId}`); } - - diff --git a/frontend/lib/api/base/base-api.ts b/frontend/lib/api/base/base-api.ts index bef9326..6db8951 100644 --- a/frontend/lib/api/base/base-api.ts +++ b/frontend/lib/api/base/base-api.ts @@ -27,9 +27,9 @@ export function parseDate(obj: T, keys: Array = []): T { export class BaseAPI { http: Requests; - attachmentToken: string + attachmentToken: string; - constructor(requests: Requests, attachmentToken: string = "") { + constructor(requests: Requests, attachmentToken = "") { this.http = requests; this.attachmentToken = attachmentToken; } diff --git a/frontend/lib/api/classes/items.ts b/frontend/lib/api/classes/items.ts index 2d6cce7..ee18f01 100644 --- a/frontend/lib/api/classes/items.ts +++ b/frontend/lib/api/classes/items.ts @@ -1,12 +1,6 @@ import { BaseAPI, route } from "../base"; import { parseDate } from "../base/base-api"; -import { - ItemAttachmentUpdate, - ItemCreate, - ItemOut, - ItemSummary, - ItemUpdate, -} from "../types/data-contracts"; +import { ItemAttachmentUpdate, ItemCreate, ItemOut, ItemSummary, ItemUpdate } from "../types/data-contracts"; import { AttachmentTypes, PaginationResult } from "../types/non-generated"; export type ItemsQuery = { diff --git a/frontend/pages/item/[id]/index.vue b/frontend/pages/item/[id]/index.vue index b003023..256ff0c 100644 --- a/frontend/pages/item/[id]/index.vue +++ b/frontend/pages/item/[id]/index.vue @@ -35,17 +35,19 @@ type Photo = { src: string; - } + }; const photos = computed(() => { - return item.value?.attachments.reduce((acc, cur) => { - if (cur.type === "photo") { - acc.push({ - src: api.authURL(`/items/${item.value.id}/attachments/${cur.id}`), - }) - } - return acc; - }, [] as Photo[]) || []; + return ( + item.value?.attachments.reduce((acc, cur) => { + if (cur.type === "photo") { + acc.push({ + src: api.authURL(`/items/${item.value.id}/attachments/${cur.id}`), + }); + } + return acc; + }, [] as Photo[]) || [] + ); }); const attachments = computed(() => { @@ -304,7 +306,7 @@ const refDialog = ref(); const dialoged = reactive({ src: "", - }) + }); function openDialog(img: Photo) { refDialog.value.showModal(); @@ -319,30 +321,22 @@ onClickOutside(refDialogBody, () => { closeDialog(); }); - - - + +