Skip to content

Commit

Permalink
feat: add types to createLibraryV2 api
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Jul 10, 2024
1 parent f16c1df commit a7fe999
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/library-authoring/LibraryAuthoringPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const libraryData: ContentLibrary = {
hasUnpublishedChanges: true,
hasUnpublishedDeletes: false,
license: '',
canEditLibrary: false,
};

const RootWrapper = () => (
Expand Down
4 changes: 3 additions & 1 deletion src/library-authoring/create-library/data/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { camelCaseObject, getConfig } from '@edx/frontend-platform';
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';

import type { ContentLibrary } from '../../data/api';

const getApiBaseUrl = () => getConfig().STUDIO_BASE_URL;

/**
Expand All @@ -17,7 +19,7 @@ export interface CreateContentLibraryArgs {
/**
* Create a new library
*/
export async function createLibraryV2(data: CreateContentLibraryArgs) {
export async function createLibraryV2(data: CreateContentLibraryArgs): Promise<ContentLibrary> {
const client = getAuthenticatedHttpClient();
const url = getContentLibraryV2CreateApiUrl();

Expand Down
1 change: 1 addition & 0 deletions src/library-authoring/data/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface ContentLibrary {
hasUnpublishedChanges: boolean;
hasUnpublishedDeletes: boolean;
license: string;
canEditLibrary: boolean;
}

/**
Expand Down

0 comments on commit a7fe999

Please sign in to comment.