mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-26 01:09:02 -05:00
* Initial * Progress * Fix * Progress * Notifications list page * BADGE_MANAGER_ADDED * Mark as seen initial * Split tables * Progress * Fix styles * Push notifs initial * Progress * Rename * Routines * Progress * Add e2e tests * Done? * Try updating actions * Consistency * Dep fix * A couple fixes
21 lines
659 B
TypeScript
21 lines
659 B
TypeScript
import type { ActionFunctionArgs } from "@remix-run/node";
|
|
import { requireUserId } from "~/features/auth/core/user.server";
|
|
import { parseRequestPayload } from "~/utils/remix.server";
|
|
import * as NotificationRepository from "../NotificationRepository.server";
|
|
import { markAsSeenActionSchema } from "../notifications-schemas";
|
|
|
|
export const action = async ({ request }: ActionFunctionArgs) => {
|
|
const user = await requireUserId(request);
|
|
const data = await parseRequestPayload({
|
|
request,
|
|
schema: markAsSeenActionSchema,
|
|
});
|
|
|
|
await NotificationRepository.markAsSeen({
|
|
userId: user.id,
|
|
notificationIds: data.notificationIds,
|
|
});
|
|
|
|
return null;
|
|
};
|