Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions client/event-planner/src/components/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const Login = ({ switchToSignup, switchToAdminSignup }) => {
const [formData, setFormData] = useState({
username: '',
password: '',
role: 'user' // Default role
});
const [errors, setErrors] = useState({});
const [touched, setTouched] = useState({
Expand Down Expand Up @@ -167,19 +166,6 @@ const Login = ({ switchToSignup, switchToAdminSignup }) => {
) : null}
</div>

<div className="form-field">
<label htmlFor="role">Login as</label>
<select
id="role"
name="role"
value={formData.role}
onChange={handleChange}
>
<option value="user">User</option>
<option value="admin">Admin</option>
</select>
</div>

<button
type="submit"
className="submit-button"
Expand Down
7 changes: 3 additions & 4 deletions client/event-planner/src/services/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export const authService = {
const { username, password, role } = credentials;
const response = await api.post('/auth/login', {
username,
password,
role
password
});
return response.data;
},
Expand Down Expand Up @@ -82,7 +81,7 @@ export const eventService = {
},

getTicket: async (id) => {
const response = await api.patch(`/manage/getTicket/${id}`);
const response = await api.post(`/manage/getTicket/${id}`);
return response.data;
}
};
Expand All @@ -95,7 +94,7 @@ export const ticketService = {
},

getTickets: async () => {
const response = await api.get('/manage/viewTickets');
const response = await api.get(`/manage/viewEventAttendees/${id}`);
return response.data;
},

Expand Down
11 changes: 11 additions & 0 deletions server/src/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ const userSchema = new mongoose.Schema({
type: Date,
required: false,
default: "2003-12-29"
},
type: {
type: String,
required: true,
default: "in person",
enum: ['in person', 'online', 'mixed']
},
capacity: {
type: Number,
required: true,
default: 100
}

// maybe users should have name, email, role, and type as required variables and other variables such as organization (For attendees) and rating (For speaker) as not required.
Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ router.patch('/promoteEvent/:_id', getUserFromJwtToken, async (req, res) => {

});

router.patch('/getTicket/:id', getUserFromJwtToken, async (req, res) => {
router.post('/getTicket/:id', getUserFromJwtToken, async (req, res) => {

const {id} =req.params;
const Event = await EventModel.findById(id) ;
Expand Down