Update queries.js

Change findOne to findUnique (breaking change in Prisma 2.12.0)

Hopefully fixes #395
This commit is contained in:
Anders 2020-12-01 21:29:36 +01:00 committed by GitHub
parent a0bab038a7
commit edb9e36101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,7 +68,7 @@ export function getTimestampInterval(field) {
export async function getWebsiteById(website_id) { export async function getWebsiteById(website_id) {
return runQuery( return runQuery(
prisma.website.findOne({ prisma.website.findUnique({
where: { where: {
website_id, website_id,
}, },
@ -78,7 +78,7 @@ export async function getWebsiteById(website_id) {
export async function getWebsiteByUuid(website_uuid) { export async function getWebsiteByUuid(website_uuid) {
return runQuery( return runQuery(
prisma.website.findOne({ prisma.website.findUnique({
where: { where: {
website_uuid, website_uuid,
}, },
@ -88,7 +88,7 @@ export async function getWebsiteByUuid(website_uuid) {
export async function getWebsiteByShareId(share_id) { export async function getWebsiteByShareId(share_id) {
return runQuery( return runQuery(
prisma.website.findOne({ prisma.website.findUnique({
where: { where: {
share_id, share_id,
}, },
@ -168,7 +168,7 @@ export async function createSession(website_id, data) {
export async function getSessionByUuid(session_uuid) { export async function getSessionByUuid(session_uuid) {
return runQuery( return runQuery(
prisma.session.findOne({ prisma.session.findUnique({
where: { where: {
session_uuid, session_uuid,
}, },
@ -225,7 +225,7 @@ export async function getAccounts() {
export async function getAccountById(user_id) { export async function getAccountById(user_id) {
return runQuery( return runQuery(
prisma.account.findOne({ prisma.account.findUnique({
where: { where: {
user_id, user_id,
}, },
@ -235,7 +235,7 @@ export async function getAccountById(user_id) {
export async function getAccountByUsername(username) { export async function getAccountByUsername(username) {
return runQuery( return runQuery(
prisma.account.findOne({ prisma.account.findUnique({
where: { where: {
username, username,
}, },