27 lines
767 B
TypeScript
27 lines
767 B
TypeScript
import {
|
|
printError,
|
|
printErrorMessageWithReason,
|
|
printObject,
|
|
} from "@/lib/output";
|
|
import { getAPIClient } from "@/lib/trpc";
|
|
import { Command } from "@commander-js/extra-typings";
|
|
|
|
export const resetCmd = new Command()
|
|
.name("reset")
|
|
.description("Initializes the database with default data")
|
|
.action(async () => {
|
|
await getAPIClient()
|
|
.users.create.mutate({
|
|
email: "ryan@ryanpandya.com",
|
|
name: "Ryan Pandya",
|
|
password: "pleasework",
|
|
confirmPassword: "pleasework",
|
|
})
|
|
.then(printObject)
|
|
.catch(
|
|
printError(
|
|
`Unable to create user for Ryan`,
|
|
),
|
|
);
|
|
});
|