Skip to content

Commit

Permalink
Merge pull request #873 from LAION-AI/web-fix-main
Browse files Browse the repository at this point in the history
Ensuring localization works everywhere and fix an admin view
  • Loading branch information
AbdBarho committed Jan 21, 2023
2 parents 186aabe + e756e5d commit 5f3f077
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion website/src/lib/oasst_api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions website/src/pages/auth/verify.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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 change: 1 addition & 0 deletions website/src/pages/tasks/all.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/tasks/random.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 5f3f077

Please sign in to comment.