Skip to content

Commit

Permalink
feat: 코드 모듈화 및 api 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
KimKyuHoi committed Nov 14, 2024
1 parent 200dce2 commit 18a4670
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/auto/apis/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
export { postValidateUrl } from './postValidateUrl.api';
export type { ValidateUrlProps, UrlOnlyProps } from './postValidateUrl.api';
export { postConvertForm } from './postConvertForm.api';
export { usefetchTaskStatus } from './fetchTaskStatus';
export { useFetchTaskStatus } from './fetchTaskStatus';
export { fetchSelectHighlight } from './fetchSelectHighLight.api';
export type { fetchSelectHighlightResponseProps } from './fetchSelectHighLight.api';
export { postHighlightSelection } from './postHighlightSelection.api';
export type {
hightlightSelectionRequestProps,
hightlightSelectionResponseProps,
} from './postHighlightSelection.api';
export { fetchVideoExtract } from './fetchVideoExtract.api';
45 changes: 45 additions & 0 deletions src/pages/auto/apis/postHighlightSelection.api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { fetchInstance } from '@/apis';

export type hightlightSelectionRequestProps = {
index: number;
s3Url: string;
title: string;
memberId: number;
categoryId: number;
};

// export type PythonDTO = {
// url: string;
// email: string;
// title: string;
// memberId: number;
// categoryId: number;
// };

export type hightlightSelectionResponseProps = {
videoId: number;
thumbnail: string;
title: string;
memberId: number;
createdAt: Date;
};

const postHighlightSelectionPath = () => '/api/videos/highlight-selection';

export const postHighlightSelection = async ({
index,
s3Url,
title,
memberId,
categoryId,
}: hightlightSelectionRequestProps): Promise<hightlightSelectionResponseProps> => {
const response = await fetchInstance.post(postHighlightSelectionPath(), {
index,
s3Url,
title,
memberId,
categoryId,
});

return response.data;
};

0 comments on commit 18a4670

Please sign in to comment.