mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-22 14:44:21 +00:00
Rename ...User... to ...Login...
This commit is contained in:
parent
ee28613791
commit
6a9aca18b5
3 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
import { createStateContext } from "../utils/stateContext";
|
||||
import { StaticImageData } from "next/image";
|
||||
import * as Telegram from "../utils/TelegramUserDataClass"
|
||||
import * as Telegram from "../utils/TelegramLoginDataClass"
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { NextApiRequest, NextApiResponse } from "next"
|
||||
import { client } from "../../../utils/prismaClient"
|
||||
import { TelegramUserDataClass } from "../../../utils/TelegramUserDataClass"
|
||||
import { TelegramLoginDataClass } from "../../../utils/TelegramLoginDataClass"
|
||||
import { default as cryptoRandomString } from "crypto-random-string"
|
||||
import { ApiResult } from "../../../types/api"
|
||||
import { FestaLoginData } from "../../../types/user"
|
||||
|
@ -40,7 +40,7 @@ async function loginTelegram(req: NextApiRequest, res: NextApiResponse<ApiResult
|
|||
}
|
||||
|
||||
try {
|
||||
var userData: TelegramUserDataClass = new TelegramUserDataClass(req.body)
|
||||
var userData: TelegramLoginDataClass = new TelegramLoginDataClass(req.body)
|
||||
}
|
||||
catch (_) {
|
||||
return res.status(422).json({ error: "Malformed data" })
|
||||
|
|
|
@ -7,7 +7,7 @@ import { TelegramLoginData } from "../types/user"
|
|||
/**
|
||||
* A {@link TelegramLoginData} object extended with various utility methods.
|
||||
*/
|
||||
export class TelegramUserDataClass {
|
||||
export class TelegramLoginDataClass {
|
||||
id: number
|
||||
firstName: string
|
||||
lastName?: string
|
||||
|
@ -18,7 +18,7 @@ export class TelegramUserDataClass {
|
|||
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.
|
||||
*/
|
Loading…
Reference in a new issue