-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './services/email.js' | ||
export * from './services/email.js' | ||
export * from './services/brand.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { db } from "../lib/prisma.js"; | ||
|
||
export async function getBrands() { | ||
const brands = await db.domains.findMany(); | ||
return brands; | ||
} | ||
|
||
export async function getBrand(id: string) { | ||
const brand = await db.domains.findUnique({ | ||
where: { | ||
id, | ||
}, | ||
}); | ||
return brand; | ||
} | ||
|
||
export async function getBrandByQuery(query: any) { | ||
const brand = await db.domains.findUnique({ | ||
where: { | ||
...query, | ||
}, | ||
}); | ||
return brand; | ||
} | ||
|
||
export async function deleteBrand(id: string) { | ||
const brand = await db.domains.delete({ | ||
where: { | ||
id, | ||
}, | ||
}); | ||
return brand; | ||
} | ||
|
||
export async function updateBrand(id: string, data: any) { | ||
const brand = await db.domains.update({ | ||
where: { | ||
id, | ||
}, | ||
data, | ||
}); | ||
return brand; | ||
} | ||
|
||
export async function createBrand(data: any) { | ||
const brand = await db.domains.create({ data }); | ||
return brand; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters