fix: add orderBy for fields

This commit is contained in:
Vasily Zubarev
2025-03-23 19:53:46 +01:00
parent 8d37570c44
commit df2d646a47
3 changed files with 6 additions and 3 deletions

View File

@@ -4,7 +4,11 @@ import { Prisma } from "@prisma/client"
import { cache } from "react"
export const getFields = cache(async () => {
return await prisma.field.findMany()
return await prisma.field.findMany({
orderBy: {
createdAt: "asc",
},
})
})
export const createField = async (field: Prisma.FieldCreateInput) => {

View File

@@ -12,7 +12,6 @@ export const getSettings = cache(async (): Promise<SettingsMap> => {
})
export const updateSettings = cache(async (code: string, value?: any) => {
console.log("updateSettings", code, value)
return await prisma.setting.upsert({
where: { code },
update: { value },

View File

@@ -1,6 +1,6 @@
{
"name": "taxhacker",
"version": "0.2.0",
"version": "0.2.1",
"private": true,
"type": "module",
"scripts": {