mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-28 04:27:24 +00:00
Add edit resource functionality.
This commit is contained in:
@@ -340,6 +340,19 @@ class Network {
|
||||
}
|
||||
}
|
||||
|
||||
async editResource(id: number, params: CreateResourceParams): Promise<Response<void>> {
|
||||
try {
|
||||
const response = await axios.post(`${this.apiBaseUrl}/resource/${id}`, params)
|
||||
return response.data
|
||||
} catch (e: any) {
|
||||
console.error(e)
|
||||
return {
|
||||
success: false,
|
||||
message: e.toString(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async getResources(page: number): Promise<PageResponse<Resource>> {
|
||||
try {
|
||||
const response = await axios.get(`${this.apiBaseUrl}/resource`, {
|
||||
|
Reference in New Issue
Block a user