Updates to documentation, fixes for edit buttons in map shifts, and CORS for local dev and access
This commit is contained in:
@@ -287,7 +287,7 @@ class ShiftsController {
|
||||
// Admin: Create shift
|
||||
async create(req, res) {
|
||||
try {
|
||||
const { title, description, date, startTime, endTime, location, maxVolunteers } = req.body;
|
||||
const { title, description, date, startTime, endTime, location, maxVolunteers, isPublic } = req.body;
|
||||
|
||||
if (!title || !date || !startTime || !endTime || !location || !maxVolunteers) {
|
||||
return res.status(400).json({
|
||||
@@ -306,6 +306,7 @@ class ShiftsController {
|
||||
'Max Volunteers': parseInt(maxVolunteers),
|
||||
'Current Volunteers': 0,
|
||||
Status: 'Open',
|
||||
'Is Public': isPublic !== false, // Default to true if not specified
|
||||
'Created By': req.session.userEmail,
|
||||
'Created At': new Date().toISOString(),
|
||||
'Updated At': new Date().toISOString()
|
||||
@@ -340,7 +341,8 @@ class ShiftsController {
|
||||
endTime: 'End Time',
|
||||
location: 'Location',
|
||||
maxVolunteers: 'Max Volunteers',
|
||||
status: 'Status'
|
||||
status: 'Status',
|
||||
isPublic: 'Is Public'
|
||||
};
|
||||
|
||||
for (const [key, field] of Object.entries(fieldMap)) {
|
||||
|
||||
Reference in New Issue
Block a user