sendou.ink/app/features/api-private/routes/users.ts
Kalle d2551d2706
Some checks failed
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled
Global roles refactor (#2212)
* Initial

* isMod etc.

* canPerformAdminActions

* isAdmin

* isSupporter

* admin override

* Lohi

* Badge manage with new permissions style

* Refactor badge loading logic

* Move funcs

* Delete permissions.ts

* DRY
2025-04-21 23:51:30 +03:00

15 lines
493 B
TypeScript

import type { ActionFunction } from "@remix-run/node";
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;
};