Some fixes
This commit is contained in:
parent
fdf6655183
commit
92266834f4
|
@ -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) }];
|
||||
|
|
|
@ -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<ArrayField, "type" | "fields">;
|
||||
|
||||
|
@ -31,6 +32,7 @@ export const creditsField = ({ validate, admin, ...props }: Props): ArrayField =
|
|||
return true;
|
||||
},
|
||||
fields: [
|
||||
rowField([
|
||||
{ name: "role", type: "relationship", relationTo: Collections.CreditsRole, required: true },
|
||||
{
|
||||
name: "recorders",
|
||||
|
@ -39,5 +41,6 @@ export const creditsField = ({ validate, admin, ...props }: Props): ArrayField =
|
|||
required: true,
|
||||
hasMany: true,
|
||||
},
|
||||
]),
|
||||
],
|
||||
});
|
||||
|
|
|
@ -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<PayloadImage> | 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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue