fix: now 409 on try to add existing usertitle
This commit is contained in:
parent
e0a68d7d0f
commit
f2589e05e8
3 changed files with 33 additions and 28 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package handlers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
oapi "nyanimedb/api"
|
||||
|
|
@ -17,11 +16,11 @@ func NewServer(db *sqlc.Queries) Server {
|
|||
return Server{db: db}
|
||||
}
|
||||
|
||||
func sql2StorageType(s *sqlc.StorageTypeT) (*oapi.ImageStorageType, error) {
|
||||
func sql2StorageType(s *sqlc.StorageTypeT) (*oapi.StorageType, error) {
|
||||
if s == nil {
|
||||
return nil, nil
|
||||
}
|
||||
var t oapi.ImageStorageType
|
||||
var t oapi.StorageType
|
||||
switch *s {
|
||||
case sqlc.StorageTypeTLocal:
|
||||
t = oapi.Local
|
||||
|
|
@ -33,7 +32,7 @@ func sql2StorageType(s *sqlc.StorageTypeT) (*oapi.ImageStorageType, error) {
|
|||
return &t, nil
|
||||
}
|
||||
|
||||
func (s Server) mapTitle(ctx context.Context, title sqlc.GetTitleByIDRow) (oapi.Title, error) {
|
||||
func (s Server) mapTitle(title sqlc.GetTitleByIDRow) (oapi.Title, error) {
|
||||
|
||||
oapi_title := oapi.Title{
|
||||
EpisodesAired: title.EpisodesAired,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue