mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
15 lines
490 B
TypeScript
15 lines
490 B
TypeScript
import type { ActionFunction } from "react-router";
|
|
import * as UserRepository from "~/features/user-page/UserRepository.server";
|
|
import { canAccessLohiEndpoint } from "~/utils/remix.server";
|
|
|
|
export const action: ActionFunction = async ({ request }) => {
|
|
if (!canAccessLohiEndpoint(request)) {
|
|
throw new Response(null, { status: 403 });
|
|
}
|
|
|
|
// input untyped but we trust Lohi to give us correctly shaped request here
|
|
UserRepository.updateMany(await request.json());
|
|
|
|
return null;
|
|
};
|