mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 06:27:19 +01:00
drop some types in
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { ILatest } from '../interfaces/ILatest'
|
||||
|
||||
function checkStatus(res: Response) {
|
||||
if (res.status < 200 || res.status >= 400) {
|
||||
throw new Error(`Something went wrong (Status ${res.status}) - I do feel very sorry!`)
|
||||
@@ -18,7 +20,7 @@ export async function generatePdf(state: Record<string, string>) {
|
||||
return response.json()
|
||||
}
|
||||
|
||||
export async function getLatest() {
|
||||
export async function getLatest(): Promise<ILatest[]> {
|
||||
const response = await fetch('/api/pdf/latest')
|
||||
checkStatus(response)
|
||||
return response.json()
|
||||
|
||||
Reference in New Issue
Block a user