Fix for no Files present in tenant
This commit is contained in:
@@ -237,7 +237,7 @@ export default async function fileRoutes(server: FastifyInstance) {
|
|||||||
// MULTIPLE PRESIGNED URLs
|
// MULTIPLE PRESIGNED URLs
|
||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
if (!ids || !Array.isArray(ids) || ids.length === 0) {
|
if (!ids || !Array.isArray(ids) || ids.length === 0) {
|
||||||
return reply.code(400).send({ error: "No ids provided" })
|
return { files: [] }
|
||||||
}
|
}
|
||||||
|
|
||||||
const rows = await server.db
|
const rows = await server.db
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ export const useFiles = () => {
|
|||||||
let data = []
|
let data = []
|
||||||
data = await useEntities("files").select("*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)")
|
data = await useEntities("files").select("*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)")
|
||||||
|
|
||||||
|
if (!Array.isArray(data) || data.length === 0) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const res = await useNuxtApp().$api("/api/files/presigned",{
|
const res = await useNuxtApp().$api("/api/files/presigned",{
|
||||||
@@ -138,4 +141,4 @@ export const useFiles = () => {
|
|||||||
|
|
||||||
|
|
||||||
return {uploadFiles, selectDocuments, selectSomeDocuments, selectDocument, downloadFile, dataURLtoFile}
|
return {uploadFiles, selectDocuments, selectSomeDocuments, selectDocument, downloadFile, dataURLtoFile}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,9 +371,9 @@ const syncdokubox = async () => {
|
|||||||
<UProgress animation="carousel" class="w-1/2"/>
|
<UProgress animation="carousel" class="w-1/2"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div v-if="displayMode === 'list'">
|
<div v-if="displayMode === 'list'">
|
||||||
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-800">
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-800">
|
||||||
<thead class="bg-gray-50 dark:bg-gray-800 sticky top-0 z-20">
|
<thead class="bg-gray-50 dark:bg-gray-800 sticky top-0 z-20">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold sm:pl-6">Name</th>
|
<th class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold sm:pl-6">Name</th>
|
||||||
@@ -412,6 +412,11 @@ const syncdokubox = async () => {
|
|||||||
</UDropdown>
|
</UDropdown>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-if="renderedFileList.length === 0">
|
||||||
|
<td colspan="3" class="px-6 py-16 text-center text-sm text-gray-500">
|
||||||
|
Keine Dateien oder Ordner vorhanden.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -438,6 +443,12 @@ const syncdokubox = async () => {
|
|||||||
/>
|
/>
|
||||||
<span class="text-xs font-medium text-center truncate w-full">{{ entry.label }}</span>
|
<span class="text-xs font-medium text-center truncate w-full">{{ entry.label }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="renderedFileList.length === 0"
|
||||||
|
class="col-span-full rounded-xl border border-dashed border-gray-300 dark:border-gray-700 px-6 py-16 text-center text-sm text-gray-500"
|
||||||
|
>
|
||||||
|
Keine Dateien oder Ordner vorhanden.
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</UDashboardPanelContent>
|
</UDashboardPanelContent>
|
||||||
@@ -497,4 +508,4 @@ const syncdokubox = async () => {
|
|||||||
</template>
|
</template>
|
||||||
</UCard>
|
</UCard>
|
||||||
</UModal>
|
</UModal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user