add fix for eroor notification
This commit is contained in:
parent
5a8b35c65c
commit
d6180ddc3e
@ -704,6 +704,9 @@ func GetDonatForPlaying(donatService model.DonatService) echo.HandlerFunc {
|
||||
slog.Error("Failed to get playing donat", "error", err)
|
||||
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to get playing donat")
|
||||
}
|
||||
if playingDonat.OrderID == "" {
|
||||
return echo.NewHTTPError(http.StatusNotFound, "Not found active donat!")
|
||||
}
|
||||
return request.JSON(http.StatusOK, playingDonat)
|
||||
|
||||
}
|
||||
|
@ -847,6 +847,9 @@ func (repoDonat *RepoDonat) GetPlayingDonat(
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
return model.PlayingDonat{}, nil
|
||||
}
|
||||
slog.Error("Failed to get playing donats", "error", err)
|
||||
return model.PlayingDonat{}, err
|
||||
}
|
||||
|
@ -73,7 +73,6 @@ func (widgetRepo *RepoWidget) CheckWidgetName(
|
||||
err := row.Scan(&widgetId)
|
||||
if err != nil {
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
println("no rows")
|
||||
return false, nil
|
||||
}
|
||||
slog.Error("failed to check widget name", "error", err.Error())
|
||||
|
@ -650,6 +650,10 @@ func (donatService *ServiceDonat) GetPlayingDonat(
|
||||
return model.PlayingDonat{}, err
|
||||
}
|
||||
|
||||
if playingDonat.OrderID == "" {
|
||||
return playingDonat, nil
|
||||
}
|
||||
|
||||
if playingDonat.Image != nil {
|
||||
imageUuid, err := uuid.Parse(*playingDonat.Image)
|
||||
if err != nil {
|
||||
@ -660,11 +664,11 @@ func (donatService *ServiceDonat) GetPlayingDonat(
|
||||
}
|
||||
|
||||
if playingDonat.Audio != nil {
|
||||
imageUuid, err := uuid.Parse(*playingDonat.Audio)
|
||||
audioUuid, err := uuid.Parse(*playingDonat.Audio)
|
||||
if err != nil {
|
||||
return model.PlayingDonat{}, err
|
||||
}
|
||||
fileUrl := donatService.storage.DownloadLink(imageUuid)
|
||||
fileUrl := donatService.storage.DownloadLink(audioUuid)
|
||||
playingDonat.Audio = &fileUrl
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user