Skip to content

Commit

Permalink
fix: set drive id from context
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed Jan 29, 2024
1 parent d6fdd6e commit d45d452
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions api/src/modules/DocumentDrive/queries/drive.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { nonNull, queryField } from 'nexus';
import { DocumentDriveState } from '../definitions';
import { nonNull, queryField } from "nexus";
import { DocumentDriveState } from "../definitions";

export const getDrive = queryField('drive', {
export const getDrive = queryField("drive", {
type: DocumentDriveState,
args: {
id: nonNull('String'),
},
resolve: async (_parent, { id }, ctx) => {
resolve: async (_parent, args, ctx) => {
try {
const drive = await ctx.prisma.document.getDrive(id);
const drive = await ctx.prisma.document.getDrive(ctx.driveId ?? "1");
return drive.global;
} catch (e) {
return null;

0 comments on commit d45d452

Please sign in to comment.