Compare commits
1
Commits
376e3e9473
...
V1.0.10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04c9ff5fac |
@@ -34,6 +34,8 @@ interface Media {
|
|||||||
caption?: string;
|
caption?: string;
|
||||||
// The API returns a `categories` array (many-to-many).
|
// The API returns a `categories` array (many-to-many).
|
||||||
categories?: Category[];
|
categories?: Category[];
|
||||||
|
// The API returns `sub_categories` (snake_case); keep the other casings as fallbacks.
|
||||||
|
sub_categories?: Category[];
|
||||||
subcategories?: Category[];
|
subcategories?: Category[];
|
||||||
subCategories?: Category[];
|
subCategories?: Category[];
|
||||||
type?: string;
|
type?: string;
|
||||||
@@ -142,7 +144,9 @@ export default function MediaPage() {
|
|||||||
setCaption(row.caption ?? "");
|
setCaption(row.caption ?? "");
|
||||||
setCategoryIds((row.categories ?? []).map((c) => c.id));
|
setCategoryIds((row.categories ?? []).map((c) => c.id));
|
||||||
setSubcategoryIds(
|
setSubcategoryIds(
|
||||||
(row.subcategories ?? row.subCategories ?? []).map((c) => c.id),
|
(row.sub_categories ?? row.subcategories ?? row.subCategories ?? []).map(
|
||||||
|
(c) => c.id,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
setType(row.type ?? "audio");
|
setType(row.type ?? "audio");
|
||||||
setDuration(row.duration != null ? String(row.duration) : "");
|
setDuration(row.duration != null ? String(row.duration) : "");
|
||||||
|
|||||||
Reference in New Issue
Block a user