Spaces:
No application file
No application file
Download Tawasol.API/Endpoints/NotificationEndpoints.cs from MahmoudSaeedYousef/spaceM: direct link, hf CLI and curl.
- Browser
- Download file 752 Bytes
-
https://huggingface.co/spaces/MahmoudSaeedYousef/spaceM/resolve/main/Tawasol.API/Endpoints/NotificationEndpoints.cs
- Command line
-
hf download hf://spaces/MahmoudSaeedYousef/spaceM/Tawasol.API/Endpoints/NotificationEndpoints.cs
-
curl -L -o NotificationEndpoints.cs https://huggingface.co/spaces/MahmoudSaeedYousef/spaceM/resolve/main/Tawasol.API/Endpoints/NotificationEndpoints.cs
752 Bytes
| using System.Security.Claims; | |
| using MediatR; | |
| using Microsoft.AspNetCore.Authorization; | |
| using Tawasol.Application.Features.Notifications.Queries.GetMyNotifications; | |
| namespace Tawasol.API.Endpoints; | |
| public static class NotificationEndpoints | |
| { | |
| public static void MapNotificationEndpoints(this IEndpointRouteBuilder app) | |
| { | |
| var group = app.MapGroup("/api/notifications"); | |
| group.MapGet("/", [Authorize] async (ClaimsPrincipal user, ISender mediator) => | |
| { | |
| var userId = Guid.Parse(user.FindFirstValue(ClaimTypes.NameIdentifier)!); | |
| var result = await mediator.Send(new GetMyNotificationsQuery(userId)); | |
| return Results.Ok(result); | |
| }) | |
| .WithName("GetMyNotifications"); | |
| } | |
| } | |