Merge pull request #873 from LAION-AI/web-fix-main

Ensuring localization works everywhere and fix an admin view
This commit is contained in:
AbdBarho
2023-01-21 12:51:13 +01:00
committed by GitHub
4 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ export class OasstApiClient {
* Returns the `BackendUser` associated with `user_id`
*/
async fetch_user(user_id: string): Promise<BackendUser> {
return this.get(`/api/v1/users/users/${user_id}`);
return this.get(`/api/v1/users/${user_id}`);
}
/**
+3 -2
View File
@@ -1,6 +1,7 @@
import { useColorMode } from "@chakra-ui/react";
import Head from "next/head";
import { getCsrfToken, getProviders } from "next-auth/react";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
export default function Verify() {
const { colorMode } = useColorMode();
@@ -21,14 +22,14 @@ export default function Verify() {
);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function getServerSideProps(context) {
export async function getServerSideProps({ locale }) {
const csrfToken = await getCsrfToken();
const providers = await getProviders();
return {
props: {
csrfToken,
providers,
...(await serverSideTranslations(locale, ["common"])),
},
};
}
+1
View File
@@ -2,6 +2,7 @@ import Head from "next/head";
import { TaskOption } from "src/components/Dashboard";
import { getDashboardLayout } from "src/components/Layout";
import { TaskCategory } from "src/components/Tasks/TaskTypes";
export { getDefaultStaticProps as getStaticProps } from "src/lib/default_static_props";
const AllTasks = () => {
return (
+1
View File
@@ -4,6 +4,7 @@ import { getDashboardLayout } from "src/components/Layout";
import { LoadingScreen } from "src/components/Loading/LoadingScreen";
import { Task } from "src/components/Tasks/Task";
import { useGenericTaskAPI } from "src/hooks/tasks/useGenericTaskAPI";
export { getDefaultStaticProps as getStaticProps } from "src/lib/default_static_props";
import { TaskType } from "src/types/Task";
const RandomTask = () => {