fix: improvement response api and docs
This commit is contained in:
@@ -58,7 +58,7 @@ func LoginStaff(
|
||||
return
|
||||
}
|
||||
|
||||
responsePayload := &authdomain.LoginResponse{
|
||||
responsePayload := &authdomain.AuthResponse{
|
||||
Token: token,
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ func LoginUser(
|
||||
return
|
||||
}
|
||||
|
||||
responsePayload := &authdomain.LoginResponse{
|
||||
responsePayload := &authdomain.AuthResponse{
|
||||
Token: token,
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,11 @@ func RegisterUser(
|
||||
return
|
||||
}
|
||||
|
||||
response.RespondJsonSuccess(ctx, w, token)
|
||||
responsePayload := &authdomain.AuthResponse{
|
||||
Token: token,
|
||||
}
|
||||
|
||||
response.RespondJsonSuccess(ctx, w, responsePayload)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -108,7 +112,9 @@ func RegisterStaff(
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
response.RespondJsonSuccess(ctx, w, token)
|
||||
responsePayload := &authdomain.AuthResponse{
|
||||
Token: token,
|
||||
}
|
||||
response.RespondJsonSuccess(ctx, w, responsePayload)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ func CreateSubscribePlan(
|
||||
response.RespondJsonSuccess(ctx, w, struct {
|
||||
Message string
|
||||
}{
|
||||
Message: "success",
|
||||
Message: "subscription plan created successfully.",
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ type LoginReq struct {
|
||||
Password string `json:"password" validate:"required"`
|
||||
}
|
||||
|
||||
type LoginResponse struct {
|
||||
type AuthResponse struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user