some roblox stuff again
This commit is contained in:
@@ -58,7 +58,7 @@ export type OmniRecommendation = {
|
||||
sorts: RecommendationSort[];
|
||||
};
|
||||
|
||||
export async function getOmniRecommendationsHome(): Promise<OmniRecommendation> {
|
||||
export async function getOmniRecommendationsHome(): Promise<OmniRecommendation | null> {
|
||||
const data = await proxyFetch(
|
||||
`https://apis.roblox.com/discovery-api/omni-recommendation`,
|
||||
{
|
||||
@@ -77,7 +77,11 @@ export async function getOmniRecommendationsHome(): Promise<OmniRecommendation>
|
||||
}
|
||||
}
|
||||
);
|
||||
return (await data.json()) as OmniRecommendation;
|
||||
const J = await data.json();
|
||||
if (J.errors) {
|
||||
return null;
|
||||
}
|
||||
return J as OmniRecommendation;
|
||||
}
|
||||
|
||||
// https://apis.roblox.com/discovery-api/omni-recommendation
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { proxyFetch } from "./utils";
|
||||
|
||||
export type UserProfileDetails = {
|
||||
@@ -15,7 +17,7 @@ export async function getLoggedInUser(): Promise<{
|
||||
id: number;
|
||||
name: string;
|
||||
displayName: string;
|
||||
}> {
|
||||
} | null> {
|
||||
const data = await proxyFetch(
|
||||
`https://users.roblox.com/v1/users/authenticated`,
|
||||
{
|
||||
@@ -25,7 +27,11 @@ export async function getLoggedInUser(): Promise<{
|
||||
}
|
||||
}
|
||||
);
|
||||
return (await data.json()) as any as {
|
||||
const J = await data.json();
|
||||
if (J.errors) {
|
||||
return null;
|
||||
}
|
||||
return J as any as {
|
||||
id: number;
|
||||
name: string;
|
||||
displayName: string;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user