feat: add mii gender property to database
will have to create a migration script
This commit is contained in:
parent
0233d803fc
commit
412b0e775b
3 changed files with 13 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
-- CreateEnum
|
||||
CREATE TYPE "MiiGender" AS ENUM ('MALE', 'FEMALE');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "miis" ADD COLUMN "gender" "MiiGender";
|
||||
|
|
@ -72,6 +72,7 @@ model Mii {
|
|||
|
||||
firstName String
|
||||
lastName String
|
||||
gender MiiGender?
|
||||
islandName String
|
||||
allowedCopying Boolean
|
||||
|
||||
|
|
@ -111,6 +112,11 @@ model Report {
|
|||
@@map("reports")
|
||||
}
|
||||
|
||||
enum MiiGender {
|
||||
MALE
|
||||
FEMALE
|
||||
}
|
||||
|
||||
enum ReportType {
|
||||
MII
|
||||
USER
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import sharp from "sharp";
|
|||
|
||||
import qrcode from "qrcode-generator";
|
||||
import { profanity } from "@2toad/profanity";
|
||||
import { MiiGender } from "@prisma/client";
|
||||
|
||||
import { auth } from "@/lib/auth";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
|
@ -99,6 +100,7 @@ export async function POST(request: NextRequest) {
|
|||
|
||||
firstName: conversion.tomodachiLifeMii.firstName,
|
||||
lastName: conversion.tomodachiLifeMii.lastName,
|
||||
gender: conversion.mii.gender == 0 ? MiiGender.MALE : MiiGender.FEMALE,
|
||||
islandName: conversion.tomodachiLifeMii.islandName,
|
||||
allowedCopying: conversion.mii.allowCopying,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue