1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 07:04:22 +00:00

Rename ...User... to ...Login...

This commit is contained in:
Steffo 2022-05-31 16:38:33 +02:00
parent ee28613791
commit 6a9aca18b5
Signed by: steffo
GPG key ID: 6965406171929D01
3 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
import { createStateContext } from "../utils/stateContext"; import { createStateContext } from "../utils/stateContext";
import { StaticImageData } from "next/image"; import { StaticImageData } from "next/image";
import * as Telegram from "../utils/TelegramUserDataClass" import * as Telegram from "../utils/TelegramLoginDataClass"
/** /**

View file

@ -1,6 +1,6 @@
import { NextApiRequest, NextApiResponse } from "next" import { NextApiRequest, NextApiResponse } from "next"
import { client } from "../../../utils/prismaClient" import { client } from "../../../utils/prismaClient"
import { TelegramUserDataClass } from "../../../utils/TelegramUserDataClass" import { TelegramLoginDataClass } from "../../../utils/TelegramLoginDataClass"
import { default as cryptoRandomString } from "crypto-random-string" import { default as cryptoRandomString } from "crypto-random-string"
import { ApiResult } from "../../../types/api" import { ApiResult } from "../../../types/api"
import { FestaLoginData } from "../../../types/user" import { FestaLoginData } from "../../../types/user"
@ -40,7 +40,7 @@ async function loginTelegram(req: NextApiRequest, res: NextApiResponse<ApiResult
} }
try { try {
var userData: TelegramUserDataClass = new TelegramUserDataClass(req.body) var userData: TelegramLoginDataClass = new TelegramLoginDataClass(req.body)
} }
catch (_) { catch (_) {
return res.status(422).json({ error: "Malformed data" }) return res.status(422).json({ error: "Malformed data" })

View file

@ -7,7 +7,7 @@ import { TelegramLoginData } from "../types/user"
/** /**
* A {@link TelegramLoginData} object extended with various utility methods. * A {@link TelegramLoginData} object extended with various utility methods.
*/ */
export class TelegramUserDataClass { export class TelegramLoginDataClass {
id: number id: number
firstName: string firstName: string
lastName?: string lastName?: string
@ -18,7 +18,7 @@ export class TelegramUserDataClass {
lang?: string lang?: string
/** /**
* Construct a {@link TelegramUserDataClass} object from a {@link TelegramLoginData}, validating it in the process. * Construct a {@link TelegramLoginDataClass} object from a {@link TelegramLoginData}, validating it in the process.
* *
* @param u The {@link TelegramLoginData} to use. * @param u The {@link TelegramLoginData} to use.
*/ */