mirror of
https://github.com/FranP-code/spooky-spotify-showcase.git
synced 2025-10-13 00:02:36 +00:00
Moved conditions and defined second queries/mutations
This commit is contained in:
@@ -11,6 +11,7 @@ export type Entry = {
|
||||
type: "artist" | "album";
|
||||
name: string;
|
||||
image: string;
|
||||
number?: number;
|
||||
};
|
||||
|
||||
export const entryRouter = createTRPCRouter({
|
||||
@@ -20,6 +21,7 @@ export const entryRouter = createTRPCRouter({
|
||||
type: z.enum(["artist", "album"]),
|
||||
name: z.string().min(1),
|
||||
image: z.string().min(1),
|
||||
number: z.number().optional(),
|
||||
}),
|
||||
)
|
||||
.query(async ({ ctx, input }) => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as cloudinary from "cloudinary";
|
||||
import { Entry } from "../api/routers/entry";
|
||||
|
||||
export const generateEntryUniqueKey = (entry: Entry): string => {
|
||||
return `${entry.type}:${entry.name.trim().toLowerCase().replace(/\s/g, "-")}`;
|
||||
return `${entry.type}:${entry.name.trim().toLowerCase().replace(/\s/g, "-")}:${entry.number || 1}`;
|
||||
};
|
||||
|
||||
export const uploadImage = async (
|
||||
|
||||
Reference in New Issue
Block a user