feat: added images for ban screen, added reportscreen, added reportsscreen for mods & admins
This commit is contained in:
parent
75d75a2c84
commit
cb7ca62590
43 changed files with 358 additions and 46 deletions
|
@ -38,8 +38,8 @@ public static class ImagesRepository
|
|||
|
||||
public static async Task<bool> deleteImageAsync(int imageId)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
ImageData imageToDelete = await getImageByIdAsync(imageId);
|
||||
await using var db = new AppDBContext();
|
||||
db.Remove(imageToDelete);
|
||||
return await db.SaveChangesAsync() >= 1;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,15 @@ public static class ReportsRepository
|
|||
public static async Task<List<ReportData>> getReportsAsync()
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
return await db.Reports.ToListAsync();
|
||||
return await db.Reports
|
||||
.Include(report => report.ReportedPost)
|
||||
.Include(report => report.ReportedPost.Image)
|
||||
.Include(report => report.ReportedPost.Comments)
|
||||
.Include(report => report.ReportedComment)
|
||||
.Include(report => report.ReportedComment.Image)
|
||||
.Include(report => report.UserReported)
|
||||
.Include(report => report.UserReporter)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public static async Task<ReportData> getReportByIdAsync(int reportId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue