mirror of
https://github.com/ThisIsBenny/wishlist-app.git
synced 2025-05-02 13:07:40 +00:00
comment field removed from wishlist items
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
b653faceac
commit
fb4842d007
7 changed files with 23 additions and 7 deletions
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to drop the column `comment` on the `Item` table. All the data in the column will be lost.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- RedefineTables
|
||||||
|
PRAGMA foreign_keys=OFF;
|
||||||
|
CREATE TABLE "new_Item" (
|
||||||
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
|
"title" TEXT NOT NULL,
|
||||||
|
"url" TEXT NOT NULL DEFAULT '',
|
||||||
|
"imageSrc" TEXT NOT NULL DEFAULT '',
|
||||||
|
"description" TEXT NOT NULL,
|
||||||
|
"bought" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"wishlistId" TEXT NOT NULL,
|
||||||
|
CONSTRAINT "Item_wishlistId_fkey" FOREIGN KEY ("wishlistId") REFERENCES "Wishlist" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
INSERT INTO "new_Item" ("bought", "description", "id", "imageSrc", "title", "url", "wishlistId") SELECT "bought", "description", "id", "imageSrc", "title", "url", "wishlistId" FROM "Item";
|
||||||
|
DROP TABLE "Item";
|
||||||
|
ALTER TABLE "new_Item" RENAME TO "Item";
|
||||||
|
PRAGMA foreign_key_check;
|
||||||
|
PRAGMA foreign_keys=ON;
|
|
@ -25,7 +25,6 @@ model Item {
|
||||||
url String @default("")
|
url String @default("")
|
||||||
imageSrc String @default("")
|
imageSrc String @default("")
|
||||||
description String
|
description String
|
||||||
comment String @default("")
|
|
||||||
bought Boolean @default(false)
|
bought Boolean @default(false)
|
||||||
wishlist Wishlist @relation(fields: [wishlistId], references: [id])
|
wishlist Wishlist @relation(fields: [wishlistId], references: [id])
|
||||||
wishlistId String
|
wishlistId String
|
||||||
|
|
|
@ -18,7 +18,6 @@ const wishlistData: Prisma.WishlistCreateInput[] = [
|
||||||
'https://www.lego.com/cdn/cs/set/assets/blt1fc37afef51cfa9f/40442.jpg?fit=bounds&format=jpg&quality=80&width=1500&height=1500&dpr=1',
|
'https://www.lego.com/cdn/cs/set/assets/blt1fc37afef51cfa9f/40442.jpg?fit=bounds&format=jpg&quality=80&width=1500&height=1500&dpr=1',
|
||||||
description:
|
description:
|
||||||
'Cute goldfish and fry, build-and-display BrickHeadz™ model',
|
'Cute goldfish and fry, build-and-display BrickHeadz™ model',
|
||||||
comment: '',
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,6 @@ export const wishlistItemRequestSchema = {
|
||||||
url: { type: 'string' },
|
url: { type: 'string' },
|
||||||
imageSrc: { type: 'string' },
|
imageSrc: { type: 'string' },
|
||||||
description: { type: 'string' },
|
description: { type: 'string' },
|
||||||
comment: { type: 'string' },
|
|
||||||
bought: { type: 'boolean' },
|
bought: { type: 'boolean' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -20,7 +19,6 @@ export const wishlistItemResponseSchema = {
|
||||||
url: { type: 'string' },
|
url: { type: 'string' },
|
||||||
imageSrc: { type: 'string' },
|
imageSrc: { type: 'string' },
|
||||||
description: { type: 'string', maxLength: 300 },
|
description: { type: 'string', maxLength: 300 },
|
||||||
comment: { type: 'string' },
|
|
||||||
bought: { type: 'boolean' },
|
bought: { type: 'boolean' },
|
||||||
wishlistId: { type: 'string' },
|
wishlistId: { type: 'string' },
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,7 +9,6 @@ defineProps<{
|
||||||
image: string
|
image: string
|
||||||
url?: string
|
url?: string
|
||||||
description: string
|
description: string
|
||||||
comment?: string
|
|
||||||
}>()
|
}>()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,7 +4,6 @@ export interface WishlistItem {
|
||||||
url: string
|
url: string
|
||||||
imageSrc: string
|
imageSrc: string
|
||||||
description: string
|
description: string
|
||||||
comment: string
|
|
||||||
bought: boolean
|
bought: boolean
|
||||||
wishlistId: boolean
|
wishlistId: boolean
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,6 @@ const bought = async (item: WishlistItemType): Promise<void> => {
|
||||||
:url="item.url"
|
:url="item.url"
|
||||||
:image="item.imageSrc"
|
:image="item.imageSrc"
|
||||||
:description="item.description"
|
:description="item.description"
|
||||||
:comment="item.comment"
|
|
||||||
@bought="bought(item)"
|
@bought="bought(item)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue