Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
feat: 📦 Add story id
Browse files Browse the repository at this point in the history
  • Loading branch information
Datlyfe committed Apr 19, 2022
1 parent c9389bb commit fbee773
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ExportButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const createStory = async (
const story = api.getCurrentStoryData() as Story;

const storyName = story.name;
const storyId = story.id;

let SBRenderCallback = (() => {}) as any;

Expand Down Expand Up @@ -292,6 +293,7 @@ const createStory = async (
height,
name: storyName,
width,
storybookId: storyId,
});
};

Expand Down
3 changes: 3 additions & 0 deletions src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface CreateStoryArgs {
defaultHTML: string;
defaultCSS: string;
name: string;
storybookId: string;
}

export const authenticate = async (storybookToken: string) => {
Expand Down Expand Up @@ -59,6 +60,7 @@ export const createStoryRequest = async (args: CreateStoryArgs) => {
width,
defaultCSS,
defaultHTML,
storybookId,
} = args;
if (!storybookToken) return Promise.reject("No token");

Expand All @@ -70,6 +72,7 @@ export const createStoryRequest = async (args: CreateStoryArgs) => {
width,
height,
name,
storybookId,
storybook_auth_token: storybookToken,
default_css: defaultCSS,
default_html: defaultHTML,
Expand Down

0 comments on commit fbee773

Please sign in to comment.