WIP: add missing handlers, services nd repositories
This commit is contained in:
@@ -67,11 +67,10 @@ func (repository *MediaFileRepository) Add(context context.Context, url string)
|
||||
}
|
||||
|
||||
func (repository *MediaFileRepository) Delete(context context.Context, id string) error {
|
||||
var file = models.MediaFile{ID: id}
|
||||
slog.Info("MediaFileRepository#Delete", "id", id)
|
||||
result := repository.db.Delete(&file)
|
||||
if result.Error != nil {
|
||||
slog.Info("MediaFileRepository#Delete", "error", result.Error.Error())
|
||||
_, err := repository.db.NewDelete().Model((*models.MediaFile)(nil)).Where("id = ?", id).Exec(context)
|
||||
if err != nil {
|
||||
slog.Info("MediaFileRepository#Delete", "error", err.Error())
|
||||
}
|
||||
return result.Error
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user