Fix type casting in creators endpoint POST
cgen-ab4e89e188a3492b82638b8c9fbc8e6f
This commit is contained in:
parent
d4e6e1d0f3
commit
ba8120ab38
3 changed files with 5 additions and 5 deletions
|
|
@ -119,7 +119,7 @@ export async function getCreatorByUsername(username: string) {
|
|||
|
||||
export async function createCreatorProfile(req: Request, userId: string) {
|
||||
try {
|
||||
const body = await req.json();
|
||||
const body = (await req.json()) as any;
|
||||
const {
|
||||
username,
|
||||
bio,
|
||||
|
|
@ -164,7 +164,7 @@ export async function createCreatorProfile(req: Request, userId: string) {
|
|||
|
||||
export async function updateCreatorProfile(req: Request, userId: string) {
|
||||
try {
|
||||
const body = await req.json();
|
||||
const body = (await req.json()) as any;
|
||||
const {
|
||||
username,
|
||||
bio,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const supabase = createClient(supabaseUrl, supabaseServiceRole);
|
|||
|
||||
export async function linkDevConnectAccount(req: Request, userId: string) {
|
||||
try {
|
||||
const body = await req.json();
|
||||
const body = (await req.json()) as { devconnect_username?: string; devconnect_profile_url?: string };
|
||||
const { devconnect_username, devconnect_profile_url } = body;
|
||||
|
||||
if (!devconnect_username) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
|
|||
);
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
const errorData = (await response.json()) as any;
|
||||
console.error("[Discord] Registration error:", errorData);
|
||||
return res.status(response.status).json({
|
||||
error: "Failed to register commands",
|
||||
|
|
@ -95,7 +95,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
|
|||
});
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
const data = (await response.json()) as any[];
|
||||
console.log("[Discord] Successfully registered commands:", data);
|
||||
|
||||
return res.status(200).json({
|
||||
|
|
|
|||
Loading…
Reference in a new issue