mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 21:35:19 +00:00
fix: add orderBy for fields
This commit is contained in:
@@ -4,7 +4,11 @@ import { Prisma } from "@prisma/client"
|
|||||||
import { cache } from "react"
|
import { cache } from "react"
|
||||||
|
|
||||||
export const getFields = cache(async () => {
|
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) => {
|
export const createField = async (field: Prisma.FieldCreateInput) => {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ export const getSettings = cache(async (): Promise<SettingsMap> => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const updateSettings = cache(async (code: string, value?: any) => {
|
export const updateSettings = cache(async (code: string, value?: any) => {
|
||||||
console.log("updateSettings", code, value)
|
|
||||||
return await prisma.setting.upsert({
|
return await prisma.setting.upsert({
|
||||||
where: { code },
|
where: { code },
|
||||||
update: { value },
|
update: { value },
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "taxhacker",
|
"name": "taxhacker",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user