feat: return organisationId if user is an organization

this will help to determine if an event is created by the user or not
This commit is contained in:
2025-05-19 01:49:33 +02:00
parent ef7ec0fc33
commit 82936633f1
4 changed files with 33 additions and 0 deletions

View File

@@ -54,6 +54,12 @@ public class GeneralUseHelpers
return org;
}
async public Task<Organisation?> GetOrganisationFromUserId(int userId)
{
Organisation? org = await _context.Organisations.FirstOrDefaultAsync(o => o.UserId == userId);
return org;
}
public string? GetTokenStrFromHTTPContext(HttpContext httpContext)
{
var cookies = httpContext.Request.Cookies;