New Backend changes

This commit is contained in:
2025-08-31 18:28:59 +02:00
parent 8d5e158d59
commit af86fdd8ed
4 changed files with 31 additions and 33 deletions

View File

@@ -14,7 +14,7 @@ export const useEntities = (
const select = async (
select: string = "*",
sortColumn: string | null = null,
ascending: boolean = false,
ascending: boolean = true,
noArchivedFiltering: boolean = false
) => {
@@ -23,7 +23,7 @@ export const useEntities = (
params: {
select,
sort: sortColumn || undefined,
asc: ascending
asc: ascending ? "true" : "false"
}
})
@@ -36,24 +36,6 @@ export const useEntities = (
return data
}
const selectSpecial = async (
select: string = "*",
sortColumn: string | null = null,
ascending: boolean = false,
) => {
const res = await useNuxtApp().$api(`/api/resource-special/${relation}`, {
method: "GET",
params: {
select,
sort: sortColumn || undefined,
asc: ascending
}
})
return res
}
const selectSingle = async (
idToEq: string | number,
select: string = "*",
@@ -61,7 +43,7 @@ export const useEntities = (
) => {
if (!idToEq) return null
const res = await useNuxtApp().$api(withInformation ? `/api/resource/${relation}/${idToEq}/${withInformation}` : `/api/resource/${relation}/${idToEq}`, {
const res = await useNuxtApp().$api(`/api/resource/${relation}/${idToEq}/${withInformation}`, {
method: "GET",
params: { select }
})
@@ -131,7 +113,7 @@ export const useEntities = (
return res
}
return {select, create, update, archive, selectSingle, selectSpecial}
return {select, create, update, archive, selectSingle}
}