Skip to content

Commit

Permalink
Change CanvasByOwnerIndex shape (was an array of arrays, now it's sim…
Browse files Browse the repository at this point in the history
…ply an array of refs)
  • Loading branch information
Vadorequest committed Mar 19, 2021
1 parent c6ec461 commit 34f6e98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/types/faunadb/CanvasByOwnerIndex.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { values } from 'faunadb';

export type CanvasByOwnerIndexData = [
values.Ref,
];
import { TypeOfRef } from './TypeOfRef';

export type CanvasByOwnerIndex = {
data: CanvasByOwnerIndexData[];
data: TypeOfRef[];
};
3 changes: 1 addition & 2 deletions src/utils/canvasStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ export const findOrCreateUserCanvas = async (user: Partial<UserSession>): Promis
} else {
// Return existing canvas reference
// Although users could have several canvas (projects), they can only create one and thus we only care about the first
const [canvasRef] = findUserCanvasResult.data[0];
return canvasRef;
return findUserCanvasResult.data[0];
}
} catch (e) {
console.error(`[findOrCreateUserCanvas] Error while fetching canvas:`, e);
Expand Down

1 comment on commit 34f6e98

@vercel
Copy link

@vercel vercel bot commented on 34f6e98 Mar 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.