Skip to content

Commit

Permalink
Add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed Dec 4, 2024
1 parent 03c175b commit 84624cc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions backend/FwHeadless/Services/HttpHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace FwHeadless.Services;

public static class HttpHelpers
{
public static Guid? GetProjectId(this HttpContext? context)
{
if (context is null) return null;
if (context.Request.Query.TryGetValue("projectId", out var projectIds) && projectIds.FirstOrDefault() is string idStr)
{
if (Guid.TryParse(idStr, out var projectId)) return projectId;
}
return null;
}
}

0 comments on commit 84624cc

Please sign in to comment.