Skip to content

Commit

Permalink
refactor: clean up imports and improve updateStory function documenta…
Browse files Browse the repository at this point in the history
…tion

- Removed unused imports from `index.test.ts`
- Enhanced JSDoc for `updateStory` function in `actions.ts`
- Removed unused `StoryContent` type import
- Clarified parameters and added more descriptive documentation for story update method
  • Loading branch information
alvarosabu committed Mar 6, 2025
1 parent 162f0b6 commit 9d01c14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/commands/migrations/run/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { session } from '../../../session';
import { konsola } from '../../../utils';
// Import the main components module first to ensure proper initialization
Expand Down
7 changes: 5 additions & 2 deletions src/commands/stories/actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { customFetch } from '../../utils/fetch';
import { getStoryblokUrl } from '../../utils/api-routes';
import type { RegionCode, SpaceOptions } from '../../constants';
import type { StoriesFilterOptions, StoriesQueryParams, Story, StoryContent } from './constants';
import type { StoriesFilterOptions, StoriesQueryParams, Story } from './constants';
import { handleAPIError } from '../../utils/error';
import { objectToStringParams } from '../../utils';

Expand Down Expand Up @@ -111,7 +111,10 @@ export const fetchStory = async (
* @param token - The authentication token
* @param region - The region code
* @param storyId - The ID of the story to update
* @param content - The new content for the story
* @param payload - The payload containing story data and update options
* @param payload.story - The story data to update
* @param payload.force_update - Whether to force the update (optional)
* @param payload.publish - Whether to publish the story (optional)
* @returns Promise with the updated story or undefined if error occurs
*/
export const updateStory = async (
Expand Down

0 comments on commit 9d01c14

Please sign in to comment.