From 3fdd96adbcffc96cc8dbdca7433bfd1c8b78301b Mon Sep 17 00:00:00 2001 From: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Date: Fri, 8 Oct 2021 06:26:36 +0800 Subject: [PATCH] fix orderBy to prioritize system fields first (#8602) --- app/src/stores/fields.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/stores/fields.ts b/app/src/stores/fields.ts index bdd69639f9..b49240afde 100644 --- a/app/src/stores/fields.ts +++ b/app/src/stores/fields.ts @@ -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[] {