edit server side code error message for wrong user input
This commit is contained in:
parent
fe446b1b09
commit
f5f23d85e0
|
@ -30,8 +30,8 @@ app.post('/merge', async (req, res) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Validate the input
|
// Validate the input
|
||||||
if (!linkGroupName || !calendars || !Array.isArray(calendars)) {
|
if (!linkGroupName || !calendars || !Array.isArray(calendars) || calendars.length === 0) {
|
||||||
return res.status(400).json({ error: 'Invalid input' });
|
return res.status(400).json({ error: 'Invalid input. Please provide a linkGroupName and at least one calendar.' });
|
||||||
}
|
}
|
||||||
// Generate a unique identifier for this set of calendars
|
// Generate a unique identifier for this set of calendars
|
||||||
const calendarId = crypto.randomBytes(16).toString('hex');
|
const calendarId = crypto.randomBytes(16).toString('hex');
|
||||||
|
|
Loading…
Reference in New Issue