Skip to content

Commit a4f4ce2

Browse files
committed
wip-ci/cd pipepline
1 parent db4a09e commit a4f4ce2

3 files changed

Lines changed: 24 additions & 6 deletions

File tree

frontend/user/src/Pages/Mockups/Gallery.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useQuery } from '@tanstack/react-query'
22
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'
33
import { Button } from '@/components/ui/button'
44
import { Skeleton } from '@/components/ui/skeleton'
5+
import { Mockup } from '@/types'
56

67
async function fetchMockups() {
78
const response = await fetch('/api/mockups')
@@ -22,15 +23,15 @@ export default function MockupGallery() {
2223
<Skeleton key={i} className="h-64 w-full rounded-lg" />
2324
))
2425
) : (
25-
mockups?.map((mockup) => (
26+
mockups?.map((mockup: Mockup) => (
2627
<Card key={mockup.id}>
2728
<CardHeader>
28-
<CardTitle>{mockup.design.name}</CardTitle>
29+
<CardTitle>{mockup.design!.name}</CardTitle>
2930
</CardHeader>
3031
<CardContent>
31-
<img
32-
src={mockup.imageUrl}
33-
alt={mockup.design.name}
32+
<img
33+
src={mockup.imageUrl!}
34+
alt={mockup.design!.name}
3435
className="rounded-lg mb-4"
3536
/>
3637
<div className="flex gap-2">
@@ -48,4 +49,4 @@ export default function MockupGallery() {
4849
</div>
4950
</div>
5051
)
51-
}
52+
}

frontend/user/src/types/design.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { MockupLayer } from "./mockup";
22

33
export interface Design {
44
id: number;
5+
name: string;
56
title: string;
67
thumbnail: string;
78
image_path: string;

frontend/user/src/types/mockup.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ export type MockupJsonDataType = {
2121
export type MockupStatus = 'draft' | 'completed';
2222
export type PrintAreaPosition = 'front' | 'back' |'leftSleeve' | 'rightSleeve';
2323

24+
25+
export interface Design {
26+
id: number;
27+
name: string;
28+
title: string;
29+
thumbnail: string;
30+
image_path: string;
31+
preview_url: string;
32+
full_image_url: string;
33+
}
34+
2435
export interface Mockup {
2536
id: number;
2637
name: string;
@@ -40,6 +51,9 @@ export interface Mockup {
4051
thumbnail: string;
4152
created_at: string;
4253
updated_at: string;
54+
design: Design | null;
55+
imageUrl: string | null;
56+
4357
}
4458

4559
export interface MockupConfig {
@@ -481,6 +495,8 @@ export interface MockupTemplate {
481495
front_canvas_state: null,
482496
back_canvas_state: null,
483497
metadata: null,
498+
design: null,
499+
imageUrl: null,
484500
current_view: 'front',
485501
thumbnail: '',
486502
created_at: '',

0 commit comments

Comments
 (0)