add join role endpoint and persistency for hubs

This commit is contained in:
2026-05-06 19:08:18 +02:00
parent 03c13a6e8a
commit f68a249268
12 changed files with 991 additions and 206 deletions
+6 -3
View File
@@ -19,7 +19,7 @@ func getUserById(ctx context.Context, userId uuid.UUID) (*types.User, error) {
user, err := cache.GetUserById(userId)
if err != nil {
user = &types.User{Id: userId, Hubs: make(map[uuid.UUID]*types.Hub)}
err = postgresql.GetWholeUser(ctx, user)
err = postgresql.UserGetWhole(ctx, user)
if err != nil {
return nil, err
}
@@ -96,9 +96,12 @@ func getHubByIdStr(ctx context.Context, hubId string) (*types.Hub, error) {
}
hub, ok := cache.GetHubById(hubUuid)
if !ok {
return nil, errors.New("hub not found")
hub = &types.Hub{Id: hubUuid}
err = postgresql.HubGetWhole(ctx, hub)
if err != nil {
return nil, err
}
}
return hub, nil