s3: fix attachments not uploading on self hosted servers

this was due to s3 endpoints requesting user's subscription
which didn't exist in case of
self hosted setups
This commit is contained in:
Abdullah Atta
2025-10-09 14:13:11 +05:00
parent 32b24dead2
commit 1ecd8adee1
3 changed files with 46 additions and 34 deletions

View File

@@ -42,10 +42,10 @@ namespace Notesnook.API.Controllers
[HttpGet("active")]
[AllowAnonymous]
public async Task<IActionResult> GetActiveAnnouncements([FromQuery] string userId)
public async Task<IActionResult> GetActiveAnnouncements([FromQuery] string? userId)
{
var totalActive = await Announcements.Collection.CountDocumentsAsync(Builders<Announcement>.Filter.Eq("IsActive", true));
if (totalActive <= 0) return Ok(new Announcement[] { });
if (totalActive <= 0) return Ok(Array.Empty<Announcement>());
var announcements = (await Announcements.FindAsync((a) => a.IsActive)).Where((a) => a.UserIds == null || a.UserIds.Length == 0 || a.UserIds.Contains(userId));
foreach (var announcement in announcements)