Update website fetch and update.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import prisma from 'lib/prisma';
|
||||
|
||||
export async function getUserWebsites(where) {
|
||||
export async function getUserWebsites(userId) {
|
||||
return prisma.client.website.findMany({
|
||||
where,
|
||||
where: {
|
||||
userId,
|
||||
},
|
||||
orderBy: {
|
||||
name: 'asc',
|
||||
},
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import prisma from 'lib/prisma';
|
||||
|
||||
export async function updateWebsite(data, where) {
|
||||
export async function updateWebsite(id, data) {
|
||||
return prisma.client.website.update({
|
||||
where,
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user