mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-01-31 11:46:16 +08:00
fix(frontend,backend): move bulk-delete endpoint to standalone websites route
- Move bulk-delete endpoint from `/targets/:id/websites/bulk-delete` to `/websites/bulk-delete` - Update frontend WebsiteService to use new standalone endpoint path - Update Go backend router configuration to register bulk-delete under standalone websites routes - Update handler documentation to reflect correct endpoint path - Simplifies API structure by treating bulk operations as standalone website operations rather than target-scoped
This commit is contained in:
@@ -18,11 +18,11 @@ export interface BulkDeleteResponse {
|
||||
export class WebsiteService {
|
||||
/**
|
||||
* Bulk delete websites
|
||||
* POST /api/assets/websites/bulk-delete/
|
||||
* POST /api/websites/bulk-delete/
|
||||
*/
|
||||
static async bulkDelete(ids: number[]): Promise<BulkDeleteResponse> {
|
||||
const response = await api.post<BulkDeleteResponse>(
|
||||
`/assets/websites/bulk-delete/`,
|
||||
`/websites/bulk-delete/`,
|
||||
{ ids }
|
||||
)
|
||||
return response.data
|
||||
|
||||
@@ -200,11 +200,11 @@ func main() {
|
||||
protected.GET("/targets/:id/websites", websiteHandler.List)
|
||||
protected.GET("/targets/:id/websites/export", websiteHandler.Export)
|
||||
protected.POST("/targets/:id/websites/bulk-create", websiteHandler.BulkCreate)
|
||||
protected.POST("/targets/:id/websites/bulk-delete", websiteHandler.BulkDelete)
|
||||
|
||||
// Websites (standalone)
|
||||
protected.GET("/websites/:id", websiteHandler.GetByID)
|
||||
protected.DELETE("/websites/:id", websiteHandler.Delete)
|
||||
protected.POST("/websites/bulk-delete", websiteHandler.BulkDelete)
|
||||
|
||||
// Engines
|
||||
protected.POST("/engines", engineHandler.Create)
|
||||
|
||||
@@ -131,7 +131,7 @@ func (h *WebsiteHandler) Delete(c *gin.Context) {
|
||||
}
|
||||
|
||||
// BulkDelete deletes multiple websites by IDs
|
||||
// POST /api/targets/:id/websites/bulk-delete
|
||||
// POST /api/websites/bulk-delete
|
||||
func (h *WebsiteHandler) BulkDelete(c *gin.Context) {
|
||||
var req dto.BulkDeleteRequest
|
||||
if !dto.BindJSON(c, &req) {
|
||||
|
||||
Reference in New Issue
Block a user