Unverified Commit daa865ff authored by Zack Tanner's avatar Zack Tanner Committed by GitHub
parent 216d968c
import 'server-only' import 'server-only'
import { import { Client, fql, QuerySuccess, QueryValueObject } from 'fauna'
Client,
fql,
QuerySuccess,
QueryValueObject,
QueryFailure,
} from 'fauna'
const client = new Client({ const client = new Client({
secret: process.env.FAUNA_CLIENT_SECRET, secret: process.env.FAUNA_CLIENT_SECRET,
...@@ -17,7 +11,7 @@ export const getAllEntries = async () => { ...@@ -17,7 +11,7 @@ export const getAllEntries = async () => {
Entry.all() Entry.all()
`) `)
return dbresponse.data.data return dbresponse.data.data
} catch (error: QueryFailure | any) { } catch (error: any) {
throw new Error(error.message) throw new Error(error.message)
} }
} }
...@@ -31,7 +25,7 @@ export const createEntry = async (name: string, message: string) => { ...@@ -31,7 +25,7 @@ export const createEntry = async (name: string, message: string) => {
createdAt: Time.now(), createdAt: Time.now(),
})`) })`)
return dbresponse.data return dbresponse.data
} catch (error: QueryFailure | any) { } catch (error: any) {
throw new Error(error.message) throw new Error(error.message)
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment