feat: add asset variants endpoint
This commit is contained in:
19
apps/web/app/api/assets/[id]/variants/shape.ts
Normal file
19
apps/web/app/api/assets/[id]/variants/shape.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
type VariantRow = {
|
||||
kind: string;
|
||||
size: number;
|
||||
key: string;
|
||||
};
|
||||
|
||||
type VariantShape = {
|
||||
kind: string;
|
||||
size: number;
|
||||
key: string;
|
||||
};
|
||||
|
||||
export function shapeVariants(rows: VariantRow[]): VariantShape[] {
|
||||
return rows.map((row) => ({
|
||||
kind: row.kind,
|
||||
size: row.size,
|
||||
key: row.key,
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user