Feat: end turn endpoint
This commit is contained in:
		| @@ -70,9 +70,9 @@ func saveStateByCtx(ctx context.Context, state *models.UserState) error { | ||||
| 	return saveState(username, state) | ||||
| } | ||||
|  | ||||
| func saveFullInfoByUsername(username string, fi *models.FullInfo) error { | ||||
| func saveFullInfo(fi *models.FullInfo) error { | ||||
| 	// INFO: unfortunately working no transactions; so case are possible where first object is updated but the second is not | ||||
| 	if err := saveState(username, fi.State); err != nil { | ||||
| 	if err := saveState(fi.State.Username, fi.State); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := saveRoom(fi.Room); err != nil { | ||||
| @@ -194,7 +194,7 @@ func joinTeam(ctx context.Context, role, team string) (*models.FullInfo, error) | ||||
| 		err := errors.New("uknown role:" + role) | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	if err := saveFullInfoByUsername(fi.State.Username, fi); err != nil { | ||||
| 	if err := saveFullInfo(fi); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	return fi, nil | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder