mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +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) {
|
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,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user