added availability changing to events view
This commit is contained in:
@@ -90,6 +90,17 @@ func (a *Handler) getEventsAvailabilities() {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Handler) getEventUserAssignmentAvailability() {
|
||||
// retrieve the assignments
|
||||
if events, err := events.WithUserAvailability(a.UserName); err != nil {
|
||||
a.Status = fiber.StatusBadRequest
|
||||
|
||||
logger.Log().Msgf("getting events with tasks and user-availability failed: %v", err)
|
||||
} else {
|
||||
a.Data = events
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Handler) getEventsUserPending() {
|
||||
if events, err := events.UserPending(a.UserName); err != nil {
|
||||
a.Status = fiber.StatusInternalServerError
|
||||
|
||||
@@ -83,6 +83,9 @@ func init() {
|
||||
// all events with the availabilities of the individual users
|
||||
"events/availabilities": (*Handler).getEventsAvailabilities,
|
||||
|
||||
// all events with the task-assignments and the availability of the current user
|
||||
"events/user/assignmentAvailability": (*Handler).getEventUserAssignmentAvailability,
|
||||
|
||||
// events the user has to enter his availability for
|
||||
"events/user/pending": (*Handler).getEventsUserPending,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user