fix: now post usertitle dont need title body
This commit is contained in:
parent
9139c77c5f
commit
65b76d58c3
4 changed files with 64 additions and 7 deletions
|
|
@ -140,9 +140,9 @@ func UserTitleStatus2Sqlc(s *[]oapi.UserTitleStatus) ([]sqlc.UsertitleStatusT, e
|
|||
}
|
||||
|
||||
func UserTitleStatus2Sqlc1(s *oapi.UserTitleStatus) (*sqlc.UsertitleStatusT, error) {
|
||||
var sqlc_status sqlc.UsertitleStatusT
|
||||
var sqlc_status sqlc.UsertitleStatusT = sqlc.UsertitleStatusTFinished
|
||||
if s == nil {
|
||||
return nil, nil
|
||||
return &sqlc_status, nil
|
||||
}
|
||||
|
||||
switch *s {
|
||||
|
|
@ -304,7 +304,7 @@ func (s Server) GetUsersUserIdTitles(ctx context.Context, request oapi.GetUsersU
|
|||
tmp := fmt.Sprint(*t.Title.ReleaseYear)
|
||||
new_cursor.Param = &tmp
|
||||
case "rating":
|
||||
tmp := strconv.FormatFloat(*t.Title.Rating, 'f', -1, 64)
|
||||
tmp := strconv.FormatFloat(*t.Title.Rating, 'f', -1, 64) // падает
|
||||
new_cursor.Param = &tmp
|
||||
}
|
||||
}
|
||||
|
|
@ -369,7 +369,7 @@ func (s Server) AddUserTitle(ctx context.Context, request oapi.AddUserTitleReque
|
|||
|
||||
params := sqlc.InsertUserTitleParams{
|
||||
UserID: request.UserId,
|
||||
TitleID: request.Body.Title.Id,
|
||||
TitleID: request.Body.TitleId,
|
||||
Status: *status,
|
||||
Rate: request.Body.Rate,
|
||||
ReviewID: request.Body.ReviewId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue