3
0

Add missing sorting to application codegen definition

This commit is contained in:
Tomaž Jerman 2022-06-16 13:06:23 +02:00
parent 4edcf0e838
commit ef503e433f
2 changed files with 13 additions and 3 deletions

View File

@ -1836,8 +1836,12 @@ func (Store) sortableApplicationFields() map[string]string {
"deleted_at": "deleted_at",
"deletedat": "deleted_at",
"id": "id",
"name": "name",
"owner_id": "owner_id",
"ownerid": "owner_id",
"updated_at": "updated_at",
"updatedat": "updated_at",
"weight": "weight",
}
}
@ -1866,6 +1870,12 @@ func (s *Store) collectApplicationCursorValues(res *systemType.Application, cc .
case "id":
cur.Set(c.Column, res.ID, c.Descending)
pkID = true
case "name":
cur.Set(c.Column, res.Name, c.Descending)
case "ownerID":
cur.Set(c.Column, res.OwnerID, c.Descending)
case "weight":
cur.Set(c.Column, res.Weight, c.Descending)
case "createdAt":
cur.Set(c.Column, res.CreatedAt, c.Descending)
case "updatedAt":

View File

@ -7,10 +7,10 @@ import (
application: schema.#Resource & {
struct: {
id: schema.IdField
name: {}
owner_id: { ident: "ownerID", goType: "uint64", storeIdent: "rel_owner" }
name: {sortable: true}
owner_id: { ident: "ownerID", goType: "uint64", storeIdent: "rel_owner", sortable: true }
enabled: {goType: "bool"}
weight: {goType: "int"}
weight: {goType: "int", sortable: true}
unify: {goType: "*types.ApplicationUnify"}
created_at: schema.SortableTimestampField
updated_at: schema.SortableTimestampNilField