mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-28 04:27:24 +00:00
Enhance comment functionality with image support and validation.
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user