-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start topic content resource, fix resource updating
- Loading branch information
Showing
15 changed files
with
100 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { TopicContentType } from "@/constants/common"; | ||
import { ITask } from "./task"; | ||
import { ILecture } from "./lecture"; | ||
import { ITopic } from "./topic"; | ||
|
||
export interface ITopicContent { | ||
id: number; | ||
type: TopicContentType; | ||
orderNumber: number; | ||
taskId?: number; | ||
lectureId?: number; | ||
task?: ITask; | ||
lecture?: ILecture; | ||
topicId: number; | ||
topic: ITopic; | ||
} | ||
|
||
export interface ITopicContentCreate { | ||
type: TopicContentType; | ||
orderNumber: number; | ||
taskId?: number; | ||
lectureId?: number; | ||
topicId: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { API_TOPIC_CONTENT } from "@/constants/apiConstants"; | ||
import { ITopicContent, ITopicContentCreate } from "@/interfaces/topicContent"; | ||
import axios from "axios"; | ||
|
||
export async function getTopicContent(): Promise<ITopicContent[]> { | ||
return axios.get(API_TOPIC_CONTENT).then(({ data }) => data); | ||
} | ||
|
||
export async function getTopicContentDetails( | ||
id: number | ||
): Promise<ITopicContent> { | ||
return axios.get(`${API_TOPIC_CONTENT}${id}`).then(({ data }) => data); | ||
} | ||
|
||
export async function updateTopicContent( | ||
id: number, | ||
data: Partial<ITopicContentCreate> | ||
) { | ||
return axios | ||
.patch(`${API_TOPIC_CONTENT}${id}`, data) | ||
.then(({ data }) => data); | ||
} | ||
|
||
export async function removeTopicContent(id: number) { | ||
return axios.delete(`${API_TOPIC_CONTENT}${id}`).then(({ data }) => data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters