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