firebase sdk update + sql options

This commit is contained in:
Artemy
2026-04-05 13:52:13 +07:00
parent 27ef94721f
commit 1d35356c8c
11 changed files with 99 additions and 25 deletions
@@ -52,9 +52,17 @@ public class MediaService : IMediaService
}
}
public Task DeleteMediaAsync(Guid fileId)
public async Task DeleteMediaAsync(Guid mediaId)
{
throw new NotImplementedException();
var mediaFile = await _dbContext.MediaFiles
.FirstOrDefaultAsync(x => x.Id == mediaId)
?? throw new KeyNotFoundException($"No media found by given id {mediaId}");
await _storageService.RemoveAsync(mediaFile.Url);
_dbContext.MediaFiles.Remove(mediaFile);
await _dbContext.SaveChangesAsync();
}
public Task<Media> GetMediaByUrlAsync(string url)