adds prod container and fixes build issues
This commit is contained in:
@@ -9,7 +9,7 @@ export default function Page() {
|
||||
useEffect(() => {
|
||||
async function getUsers() {
|
||||
const { data: users } = await api.users.list({});
|
||||
setUserData(users);
|
||||
setUserData(Array.isArray(users) ? users : [users]);
|
||||
}
|
||||
getUsers();
|
||||
}, []);
|
||||
|
||||
@@ -18,7 +18,7 @@ export default function Quota({
|
||||
async function getProfile() {
|
||||
if (!auth.isLoading && !auth.error && auth.isAuthenticated) {
|
||||
const { data: profile } = await api?.profiles?.me({});
|
||||
setQuota(profile?.quota);
|
||||
setQuota((profile as Profile)?.quota);
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
|
||||
@@ -4,7 +4,8 @@ import { getUser } from "./fetch";
|
||||
import { paths, components } from "muzak/data/types";
|
||||
|
||||
const fetcher = Fetcher.for<paths>();
|
||||
const BASE_URL = process.env.BACKEND_HOST!;
|
||||
const BASE_URL = process.env.NEXT_PUBLIC_BACKEND_HOST!;
|
||||
console.log("beest url", BASE_URL);
|
||||
|
||||
// Configure the fetcher
|
||||
fetcher.configure({
|
||||
@@ -19,7 +20,7 @@ fetcher.configure({
|
||||
async (url, init, next) => {
|
||||
const user = getUser();
|
||||
if (user?.access_token) {
|
||||
init.headers = {
|
||||
(init.headers as any) = {
|
||||
...init.headers,
|
||||
Authorization: `Bearer ${user.access_token}`,
|
||||
"Content-Type": "application/json",
|
||||
@@ -76,7 +77,6 @@ export const api = {
|
||||
export type User = components["schemas"]["User"];
|
||||
export type Track = components["schemas"]["Track"];
|
||||
export type Album = components["schemas"]["Album"];
|
||||
export type Vote = components["schemas"]["Vote"];
|
||||
export type Profile = components["schemas"]["Profile"];
|
||||
|
||||
export default api;
|
||||
|
||||
Reference in New Issue
Block a user