Iceshrimp.NET/Iceshrimp.Frontend/Core/ControllerModels/NotificationControllerModel.cs
2024-07-04 18:02:00 +02:00

24 lines
No EOL
821 B
C#

using Iceshrimp.Frontend.Core.Miscellaneous;
using Iceshrimp.Frontend.Core.Services;
using Iceshrimp.Shared.Schemas.Web;
namespace Iceshrimp.Frontend.Core.ControllerModels;
internal class NotificationControllerModel(ApiClient api)
{
[LinkPagination(20, 80)]
public Task<List<NotificationResponse>> GetNotifications(PaginationQuery pq) =>
api.Call<List<NotificationResponse>>(HttpMethod.Get, "/notifications", pq);
public Task MarkNotificationAsRead(string id) =>
api.Call(HttpMethod.Post, $"/notifications/{id}/read");
public Task MarkAllNotificationsAsRead() =>
api.Call(HttpMethod.Post, "/notifications/read");
public Task DeleteNotification(string id) =>
api.Call(HttpMethod.Delete, $"/notifications/{id}");
public Task DeleteAllNotifications() =>
api.Call(HttpMethod.Delete, "/notifications");
}