diff --git a/src/collections/Folders/endpoints/getBySlugEndpoint.ts b/src/collections/Folders/endpoints/getBySlugEndpoint.ts index 7e1f578..deec32b 100644 --- a/src/collections/Folders/endpoints/getBySlugEndpoint.ts +++ b/src/collections/Folders/endpoints/getBySlugEndpoint.ts @@ -75,7 +75,6 @@ export const convertFolderToEndpointFolder = ({ ]; case Collections.Pages: return [{ relationTo: Collections.Pages, value: convertPageToEndpointPage(value) }]; - // TODO: handle media type files case Collections.Images: if (!isImage(value)) return []; return [{ relationTo: Collections.Images, value: convertImageToEndpointImage(value) }]; diff --git a/src/fields/creditsField/creditsField.ts b/src/fields/creditsField/creditsField.ts index 8dfb9dc..a509549 100644 --- a/src/fields/creditsField/creditsField.ts +++ b/src/fields/creditsField/creditsField.ts @@ -3,6 +3,7 @@ import { ArrayField } from "payload/types"; import { Collections } from "../../constants"; import { Credits } from "../../types/collections"; import { hasDuplicates, isDefined, isPayloadType, isUndefined } from "../../utils/asserts"; +import { rowField } from "../rowField/rowField"; type Props = Omit; @@ -31,13 +32,15 @@ export const creditsField = ({ validate, admin, ...props }: Props): ArrayField = return true; }, fields: [ - { name: "role", type: "relationship", relationTo: Collections.CreditsRole, required: true }, - { - name: "recorders", - type: "relationship", - relationTo: Collections.Recorders, - required: true, - hasMany: true, - }, + rowField([ + { name: "role", type: "relationship", relationTo: Collections.CreditsRole, required: true }, + { + name: "recorders", + type: "relationship", + relationTo: Collections.Recorders, + required: true, + hasMany: true, + }, + ]), ], }); diff --git a/src/utils/endpoints.ts b/src/utils/endpoints.ts index f13c77f..d593c35 100644 --- a/src/utils/endpoints.ts +++ b/src/utils/endpoints.ts @@ -232,7 +232,7 @@ const convertAttributeToEndpointAttribute = ( const { slug, icon, translations } = name; return { slug, - icon: icon ?? "material-symbols:category-outline", + icon: icon ?? "material-symbols:category", translations: translations.map(({ language, name }) => ({ language: isPayloadType(language) ? language.id : language, name, @@ -249,7 +249,7 @@ const convertAttributeToEndpointAttribute = ( const { slug, icon, translations } = name; return { slug, - icon: icon ?? "material-symbols:category-outline", + icon: icon ?? "material-symbols:category", translations: translations.map(({ language, name }) => ({ language: isPayloadType(language) ? language.id : language, name, @@ -268,7 +268,7 @@ const convertAttributeToEndpointAttribute = ( return { slug, - icon: icon ?? "material-symbols:category-outline", + icon: icon ?? "material-symbols:category", translations: translations.map(({ language, name }) => ({ language: isPayloadType(language) ? language.id : language, name, @@ -286,7 +286,6 @@ export const convertSizesToPayloadImages = ( sizes: (Nullable | undefined)[], targetSizes: number[] ): PayloadImage[] => { - if (!sizes) return []; const processedSizes = sizes.filter(isPayloadImage); const images: PayloadImage[] = []; @@ -308,6 +307,7 @@ export const convertSizesToPayloadImages = ( images.push(smallestImage); } + return images; };