fix orderBy to prioritize system fields first (#8602)

This commit is contained in:
Azri Kahar
2021-10-08 06:26:36 +08:00
committed by GitHub
parent 0ebb932f45
commit 3fdd96adbc

View File

@@ -235,7 +235,7 @@ export const useFieldsStore = defineStore({
getFieldsForCollection(collection: string): Field[] {
return orderBy(
this.fields.filter((field) => field.collection === collection),
(collection) => (collection.meta?.sort ? Number(collection.meta?.sort) : null)
[(field) => field.meta?.system === true, (field) => (field.meta?.sort ? Number(field.meta?.sort) : null)]
);
},
getFieldsForCollectionAlphabetical(collection: string): Field[] {