-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from adrianfocke/small-changes
Small changes
- Loading branch information
Showing
32 changed files
with
214 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { createClient } from '@supabase/supabase-js'; | ||
import { NextResponse } from 'next/server'; | ||
|
||
export async function POST(request: Request) { | ||
const document: string = await request.json(); | ||
|
||
const supabaseClient = createClient( | ||
process.env.SUPABASE_URL!, | ||
process.env.SUPABASE_TOKEN! | ||
); | ||
|
||
const { data, error } = await supabaseClient.storage | ||
.from('Documents') | ||
.download(`${document}`); | ||
|
||
return NextResponse.json( | ||
{ data: Array.from(new Uint8Array(await data!.arrayBuffer())) }, | ||
{ status: 200 } | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { PatchBackendParcel } from '@/types/index'; | ||
import useSWR from 'swr'; | ||
|
||
const fetcher = async (...args: any[]) => { | ||
const req = await fetch('/api/document/patch', { | ||
method: 'POST', | ||
body: JSON.stringify(args[0]), | ||
}); | ||
return await req.json(); | ||
}; | ||
|
||
export const usePatchDocument = ( | ||
file: PatchBackendParcel['file'], | ||
placeholders: PatchBackendParcel['placeholders'] | ||
) => { | ||
const { data, error, isLoading } = useSWR({ file, placeholders }, fetcher); | ||
|
||
return { | ||
document: data, | ||
isLoading, | ||
error, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { PatchBackendParcel } from '@/types/index'; | ||
import patchDocument from '@/utils/patchDocument'; | ||
import { NextResponse } from 'next/server'; | ||
|
||
export async function POST(request: Request) { | ||
const patchBackendParcel: PatchBackendParcel = await request.json(); | ||
|
||
const patch = await patchDocument(patchBackendParcel); | ||
|
||
if (!patch) { | ||
return NextResponse.json({ error: 'Could not patch document' }); | ||
} | ||
|
||
return NextResponse.json({ data: patch }, { status: 200 }); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
} | ||
], | ||
"size": 95, | ||
"name": "ÖBB Personenverkehr" | ||
"name": "ÖBB Personenverkehr AG" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
tina/collections/audits/index.tsx → tina/collections/audits.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.