Update backend/src/routes/openai.js
This commit is contained in:
parent
e9d61a19ff
commit
85fe2843e0
@ -224,8 +224,7 @@ router.post(
|
||||
'/ask-gpt',
|
||||
wrapAsync(async (req, res) => {
|
||||
const { prompt } = req.body;
|
||||
const apiKey = req.body.apiKey || req.currentUser?.gpt_key;
|
||||
if (!prompt || !apiKey) {
|
||||
if (!prompt) {
|
||||
return res.status(400).send({
|
||||
success: false,
|
||||
error: 'Question and API key are required',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user