Skip to content

Commit

Permalink
Merge pull request #241 from Viva-con-Agua/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
TobiKaestle authored Feb 27, 2025
2 parents 2bd9908 + dcb232d commit bed3ca1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions dao/participation.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ func ParticipationInsert(ctx context.Context, i *models.ParticipationCreate, tok
}
if _, err = EventApplicationsUpdate(ctx, &models.EventApplicationsUpdate{ID: i.EventID, Applications: models.EventApplications{
Requested: event.Applications.Requested + 1,
Confirmed: event.Applications.Confirmed,
Rejected: event.Applications.Rejected,
Withdrawn: event.Applications.Withdrawn,
Total: event.Applications.Total + 1,
}}); err != nil {
return
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module pool-backend
go 1.21

require (
github.com/Viva-con-Agua/vcago v1.5.7
github.com/Viva-con-Agua/vcago v1.5.11
github.com/google/uuid v1.6.0
github.com/labstack/echo/v4 v4.12.0
go.mongodb.org/mongo-driver v1.17.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Viva-con-Agua/vcago v1.5.7 h1:QYcyqn+q0qq3dhj0xSfy4Ajgn/6x0kzne/2M+4aru0o=
github.com/Viva-con-Agua/vcago v1.5.7/go.mod h1:uJ7sBZk8IOEJbHgZ97uY+WE6TLMGkhiPvey3CxFOs4A=
github.com/Viva-con-Agua/vcago v1.5.11 h1:AqMnaQuDZNxSymmLf/OFREi12IcRG/Kx/PItljSMiZk=
github.com/Viva-con-Agua/vcago v1.5.11/go.mod h1:uJ7sBZk8IOEJbHgZ97uY+WE6TLMGkhiPvey3CxFOs4A=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
Expand Down
1 change: 1 addition & 0 deletions handlers/token/artist.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func (i *ArtistHandler) Routes(group *echo.Group) {
group.Use(i.Context)
group.POST("", i.Create, accessCookie)
group.GET("", i.Get, accessCookie)
group.GET("/api_token", i.Get, vcago.KeyAuthMiddleware())
group.GET("/:id", i.GetByID, accessCookie)
group.PUT("", i.Update, accessCookie)
group.DELETE("/:id", i.Delete, accessCookie)
Expand Down
7 changes: 6 additions & 1 deletion models/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,15 @@ func (i *EventParam) PublicFilter() bson.D {
func (i *EventQuery) FilterAsp(token *AccessToken) bson.D {
filter := vmdb.NewFilter()
if token.PoolRoles.Validate(ASPEventRole) {
filter.EqualString("crew_id", token.CrewID)
status := bson.A{}
status = append(status, bson.D{{Key: "event_asp_id", Value: token.ID}})
status = append(status, bson.D{{Key: "crew_id", Value: token.CrewID}})
filter.Append(bson.E{Key: "$or", Value: status})
} else {
filter.EqualString("event_asp_id", token.ID)
}
filter.GteInt64("end_at", fmt.Sprint(time.Now().AddDate(0, -6, 0).Unix()))
filter.EqualStringList("event_state.state", []string{"published", "finished"})
return filter.Bson()
}

Expand Down

0 comments on commit bed3ca1

Please sign in to comment.