Skip to content

Commit 34f6e98

Browse files
committed
Change CanvasByOwnerIndex shape (was an array of arrays, now it's simply an array of refs)
1 parent c6ec461 commit 34f6e98

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import { values } from 'faunadb';
2-
3-
export type CanvasByOwnerIndexData = [
4-
values.Ref,
5-
];
1+
import { TypeOfRef } from './TypeOfRef';
62

73
export type CanvasByOwnerIndex = {
8-
data: CanvasByOwnerIndexData[];
4+
data: TypeOfRef[];
95
};

src/utils/canvasStream.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ export const findOrCreateUserCanvas = async (user: Partial<UserSession>): Promis
197197
} else {
198198
// Return existing canvas reference
199199
// Although users could have several canvas (projects), they can only create one and thus we only care about the first
200-
const [canvasRef] = findUserCanvasResult.data[0];
201-
return canvasRef;
200+
return findUserCanvasResult.data[0];
202201
}
203202
} catch (e) {
204203
console.error(`[findOrCreateUserCanvas] Error while fetching canvas:`, e);

0 commit comments

Comments
 (0)