mirror of
https://github.com/Receipt-Wrangler/receipt-wrangler-api.git
synced 2026-01-20 18:10:04 -06:00
26 lines
438 B
Go
26 lines
438 B
Go
package commands
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
"receipt-wrangler/api/internal/utils"
|
|
)
|
|
|
|
type BulkUserDeleteCommand struct {
|
|
UserIds []string `json:"userIds"`
|
|
}
|
|
|
|
func (command *BulkUserDeleteCommand) LoadDataFromRequest(w http.ResponseWriter, r *http.Request) error {
|
|
bytes, err := utils.GetBodyData(w, r)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = json.Unmarshal(bytes, &command)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|