Merge pull request #397 from andlil/patch-4

Update queries.js
This commit is contained in:
Mike Cao 2020-12-01 13:12:09 -08:00 committed by GitHub
commit f596afc4b7
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,
}, },