Skip to content

Commit

Permalink
chore: Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne committed Nov 7, 2022
1 parent 40d7ce6 commit cda44e4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ same storage, otherwise you'll have to reconfigure Keycloak.

To configure Keycloak:

- Access the [Keycloak admin][keycloak-admin]
- Access the [Keycloak admin][keycloak-admin] (login, password: "admin", "admin")
- Create client application
- Via import: [Keycloak][keycloak-admin] > Clients > Import client
- Use the exported client `keycloak-visualize-client-dev.json`
Expand Down
6 changes: 4 additions & 2 deletions app/db/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { createChartId } from "../utils/create-chart-id";

import prisma from "./client";

type PublishedConfig = Omit<ConfigType, "activeField">;

/**
* Store data in the DB.
* If the user is logged, the chart is linked to the user.
Expand Down Expand Up @@ -49,9 +51,9 @@ const parseDbConfig = (conf: Config) => {
const data = conf.data as ChartJsonConfig;
const migratedData = {
...data,
dataSet: migrateDataSet(data.dataSet as string),
dataSet: migrateDataSet(data.dataSet),
chartConfig: migrateChartConfig(data.chartConfig),
} as unknown as Omit<ConfigType, "activeField">;
} as PublishedConfig;
return {
...conf,
data: migratedData,
Expand Down
3 changes: 1 addition & 2 deletions app/db/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export type Serialized<P> = P & {
};

export const serializeProps = <T extends unknown>(props: T) => {
const { json, meta } = SuperJSON.serialize(props);
const sprops = json;
const { json: sprops, meta } = SuperJSON.serialize(props);
if (meta) {
// @ts-ignore
sprops._superjson = meta;
Expand Down
2 changes: 1 addition & 1 deletion app/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const nextAuthOptions = {
providers,
callbacks: {
/**
* When the is logged in, ensures it creates on our side and save its id
* When the user is logged in, ensures it creates on our side and save its id
* on the session.
*/
session: async ({ session, token }) => {
Expand Down

0 comments on commit cda44e4

Please sign in to comment.