sendou.ink/scripts/add-tournament-organization.ts
Kalle 9312fad90f
Tournament organization page (#1811)
* Initial

* Calendar initial

* Extract EventCalendar

* Events list initial

* Winners

* SQL fixes

* List events by series

* Leaderboards

* Series leaderboard

* Own entry peek

* Edit page skeleton

* RHF initial test

* RHF stuff

* Form etc. progress

* Fix tournament series description

* Fix tabs layout

* Fix socials insert

* Check for not removing admin

* Adding series

* TODOs

* Allow updating org with no series

* FormFieldset

* Allow series without events

* TextAreaFormfield accepting array syntax

* Input form array field

* ToggleFormField

* SelectFormField

* UserSearchFormField

* Fetch badgeOptions

* Badge editing

* Progress

* Use native preventScrollReset

* Rename func

* Fix sticky scroll

* Fix translation

* i18n errors

* handle,meta in edit

* Add ref to user search

* TODOs

* Done
2024-07-25 23:06:29 +03:00

23 lines
706 B
TypeScript

import "dotenv/config";
import invariant from "~/utils/invariant";
import { logger } from "~/utils/logger";
import * as TournamentOrganizationRepository from "../app/features/tournament-organization/TournamentOrganizationRepository.server";
async function main() {
const name = process.argv[2]?.trim();
const ownerIdRaw = process.argv[3]?.trim();
const ownerId = Number(ownerIdRaw);
invariant(name, "name of org is required (argument 1)");
invariant(ownerIdRaw, "owner id is required (argument 2)");
invariant(!Number.isNaN(ownerId), "owner id must be a number");
await TournamentOrganizationRepository.create({
name,
ownerId,
});
logger.info(`Added new organization: ${name}`);
}
main();