mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
Update queries.js
Change findOne to findUnique (breaking change in Prisma 2.12.0) Hopefully fixes #395
This commit is contained in:
parent
a0bab038a7
commit
edb9e36101
@ -68,7 +68,7 @@ export function getTimestampInterval(field) {
|
||||
|
||||
export async function getWebsiteById(website_id) {
|
||||
return runQuery(
|
||||
prisma.website.findOne({
|
||||
prisma.website.findUnique({
|
||||
where: {
|
||||
website_id,
|
||||
},
|
||||
@ -78,7 +78,7 @@ export async function getWebsiteById(website_id) {
|
||||
|
||||
export async function getWebsiteByUuid(website_uuid) {
|
||||
return runQuery(
|
||||
prisma.website.findOne({
|
||||
prisma.website.findUnique({
|
||||
where: {
|
||||
website_uuid,
|
||||
},
|
||||
@ -88,7 +88,7 @@ export async function getWebsiteByUuid(website_uuid) {
|
||||
|
||||
export async function getWebsiteByShareId(share_id) {
|
||||
return runQuery(
|
||||
prisma.website.findOne({
|
||||
prisma.website.findUnique({
|
||||
where: {
|
||||
share_id,
|
||||
},
|
||||
@ -168,7 +168,7 @@ export async function createSession(website_id, data) {
|
||||
|
||||
export async function getSessionByUuid(session_uuid) {
|
||||
return runQuery(
|
||||
prisma.session.findOne({
|
||||
prisma.session.findUnique({
|
||||
where: {
|
||||
session_uuid,
|
||||
},
|
||||
@ -225,7 +225,7 @@ export async function getAccounts() {
|
||||
|
||||
export async function getAccountById(user_id) {
|
||||
return runQuery(
|
||||
prisma.account.findOne({
|
||||
prisma.account.findUnique({
|
||||
where: {
|
||||
user_id,
|
||||
},
|
||||
@ -235,7 +235,7 @@ export async function getAccountById(user_id) {
|
||||
|
||||
export async function getAccountByUsername(username) {
|
||||
return runQuery(
|
||||
prisma.account.findOne({
|
||||
prisma.account.findUnique({
|
||||
where: {
|
||||
username,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user