mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-13 17:29:54 +01:00
Fix some request bugs
This commit is contained in:
10
ober.go
10
ober.go
@@ -185,6 +185,7 @@ func UserGet(ctx *fasthttp.RequestCtx) {
|
||||
func WatchGet(ctx *fasthttp.RequestCtx) {
|
||||
animeUsers, err := watchGetLogic(ctx)
|
||||
if err != nil {
|
||||
addErrorToCtx(ctx, err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -330,9 +331,11 @@ func UnRegister(ctx *fasthttp.RequestCtx) {
|
||||
// DELETE
|
||||
err = DeleteUserFromAnimes(register.MalID)
|
||||
if err != nil {
|
||||
ctx.WriteString(err.Error())
|
||||
ctx.SetStatusCode(fasthttp.StatusNotFound)
|
||||
return
|
||||
if err != nutsdb.ErrBucketEmpty {
|
||||
ctx.WriteString(err.Error())
|
||||
ctx.SetStatusCode(fasthttp.StatusNotFound)
|
||||
return
|
||||
}
|
||||
}
|
||||
err = DbDelete(bucketUsers, register.Username)
|
||||
if err != nil {
|
||||
@@ -389,6 +392,7 @@ func watchGetLogic(ctx *fasthttp.RequestCtx) ([]AnimeUser, error) {
|
||||
addErrorToCtx(ctx, err)
|
||||
return nil, err
|
||||
}
|
||||
err = nil
|
||||
animesUsers = make([]AnimeUser, 0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user