Merge branch 'dev' into feat/um-62-prisma-property-names

This commit is contained in:
Brian Cao 2022-10-10 12:15:43 -07:00
commit 3143765954
9 changed files with 30 additions and 29 deletions

View file

@ -15,7 +15,7 @@ export async function createWebsite(userId, data) {
})
.then(async res => {
if (redis.client && res) {
await redis.client.set(`website:${res.websiteUuid}`, res.websiteId);
await redis.client.set(`website:${res.websiteUuid}`, res.id);
}
return res;

View file

@ -10,7 +10,7 @@ export async function getWebsiteByUuid(websiteUuid) {
})
.then(async res => {
if (redis.client && res) {
await redis.client.set(`website:${res.websiteUuid}`, res.websiteId);
await redis.client.set(`website:${res.websiteUuid}`, res.id);
}
return res;

View file

@ -1,10 +1,8 @@
import prisma from 'lib/prisma';
export async function updateWebsite(websiteId, data) {
export async function updateWebsite(data, where) {
return prisma.client.website.update({
where: {
id: websiteId,
},
where,
data,
});
}

View file

@ -31,7 +31,7 @@ async function relationalQuery(websiteId, data) {
})
.then(async res => {
if (redis.client && res) {
await redis.client.set(`session:${res.sessionUuid}`, res.sessionId);
await redis.client.set(`session:${res.sessionUuid}`, res.id);
}
return res;