feat: add Bytescale image uploads
This commit is contained in:
@@ -20,6 +20,7 @@ export const getAllDoctors = async (req, res) => {
|
||||
SL_NO: String(index + 1),
|
||||
doctorId: doc.doctorId,
|
||||
name: doc.name,
|
||||
image: doc.image ?? "",
|
||||
designation: doc.designation,
|
||||
workingStatus: doc.workingStatus,
|
||||
qualification: doc.qualification,
|
||||
@@ -87,6 +88,7 @@ export const getDoctorByDoctorId = async (req, res) => {
|
||||
const response = {
|
||||
doctorId: doctor.doctorId,
|
||||
name: doctor.name,
|
||||
image: doctor.image ?? "",
|
||||
designation: doctor.designation,
|
||||
workingStatus: doctor.workingStatus,
|
||||
qualification: doctor.qualification,
|
||||
@@ -164,6 +166,7 @@ export const createDoctor = async (req, res) => {
|
||||
const {
|
||||
doctorId,
|
||||
name,
|
||||
image,
|
||||
designation,
|
||||
workingStatus,
|
||||
qualification,
|
||||
@@ -174,6 +177,7 @@ export const createDoctor = async (req, res) => {
|
||||
data: {
|
||||
doctorId,
|
||||
name,
|
||||
image,
|
||||
designation,
|
||||
workingStatus,
|
||||
qualification,
|
||||
@@ -221,8 +225,14 @@ export const createDoctor = async (req, res) => {
|
||||
export const updateDoctor = async (req, res) => {
|
||||
try {
|
||||
const {doctorId} = req.params;
|
||||
const {name, designation, workingStatus, qualification, departments} =
|
||||
req.body;
|
||||
const {
|
||||
name,
|
||||
designation,
|
||||
image,
|
||||
workingStatus,
|
||||
qualification,
|
||||
departments,
|
||||
} = req.body;
|
||||
|
||||
const doctor = await prisma.doctor.findUnique({
|
||||
where: {doctorId},
|
||||
@@ -236,7 +246,7 @@ export const updateDoctor = async (req, res) => {
|
||||
|
||||
await prisma.doctor.update({
|
||||
where: {id: doctor.id},
|
||||
data: {name, designation, workingStatus, qualification},
|
||||
data: {name, designation, image, workingStatus, qualification},
|
||||
});
|
||||
|
||||
const oldRelations = await prisma.doctorDepartment.findMany({
|
||||
|
||||
Reference in New Issue
Block a user