Skip to content

Commit

Permalink
Add edit question page
Browse files Browse the repository at this point in the history
  • Loading branch information
guanquann committed Sep 21, 2024
1 parent 21f3b88 commit ceef185
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ export const createImageLink = async (

try {
const files = req.files as Express.Multer.File[];

const uploadPromises = files.map((file) => uploadFileToFirebase(file));
const imageUrls = await Promise.all(uploadPromises);
res.status(200).json({ imageUrls });
res
.status(200)
.json({ message: "Images uploaded successfully", imageUrls });
} catch (error) {
res.status(500).json({ message: "Server error", error });
}
Expand Down Expand Up @@ -114,6 +117,7 @@ export const updateQuestion = async (
question: updatedQuestion,
});
} catch (error) {
console.log(error);
res.status(500).json({ message: "Server error", error });
}
};

0 comments on commit ceef185

Please sign in to comment.