Enhance comment functionality with image support and validation.

This commit is contained in:
2025-06-24 12:00:48 +08:00
parent b818777a45
commit 953b1cf86a
12 changed files with 469 additions and 88 deletions

View File

@@ -925,11 +925,12 @@ class Network {
async createComment(
resourceID: number,
content: string,
images: number[],
): Promise<Response<any>> {
try {
const response = await axios.postForm(
const response = await axios.post(
`${this.apiBaseUrl}/comments/${resourceID}`,
{ content },
{ content, images },
);
return response.data;
} catch (e: any) {
@@ -941,11 +942,12 @@ class Network {
async updateComment(
commentID: number,
content: string,
images: number[],
): Promise<Response<any>> {
try {
const response = await axios.putForm(
const response = await axios.put(
`${this.apiBaseUrl}/comments/${commentID}`,
{ content },
{ content, images },
);
return response.data;
} catch (e: any) {