Skip to content

Commit

Permalink
update for changes in jupyteach schema
Browse files Browse the repository at this point in the history
  • Loading branch information
sglyon committed May 30, 2023
1 parent d89daf0 commit 85d9e8d
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const GET_NOTEBOOK_FRAGMENT = gql`
fragment Notebook on ContentBlock {
id
createdAt
nbContent
properties
}
`;
Expand All @@ -26,8 +27,8 @@ interface IContentBlock {
authorId: number;
createdAt: string;
id: number;
nbContent: ServerContents.IModel['content'];
properties: {
nbContent: ServerContents.IModel['content'];
fileName: string;
lastModified: string;
};
Expand Down Expand Up @@ -83,10 +84,7 @@ export class JupyteachContents extends Contents {
existing => {
return {
...existing,
properties: {
...existing.properties,
nbContent: options.content
}
nbContent: options.content,

Check failure on line 87 in src/contents.ts

View workflow job for this annotation

GitHub Actions / build

Delete `,`
};
}
);
Expand Down Expand Up @@ -132,17 +130,26 @@ export class JupyteachContents extends Contents {
const nb = this.apolloClient.readFragment({
id: key,
fragment: GET_NOTEBOOK_FRAGMENT
}) as Pick<IContentBlock, 'properties' | 'createdAt' | 'id'> | null;
}) as Pick<
IContentBlock,
'properties' | 'createdAt' | 'id' | 'nbContent'
> | null;
console.debug('[contents.ts] get inside if', {
path,
options,
nb,
client: this.apolloClient
});
if (nb) {
return {
content: nb.properties.nbContent,
content: nb.nbContent,
created: nb.createdAt,
format: 'json',
last_modified: nb.properties.lastModified,
mimetype: 'application/x-ipynb+json',
name: nb.properties.fileName,
path: nb.properties.fileName,
size: JSON.stringify(nb.properties.nbContent).length,
size: JSON.stringify(nb.nbContent).length,
type: 'notebook',
writable: true
};
Expand Down

0 comments on commit 85d9e8d

Please sign in to comment.