feat: adding target returns id of added entry

This commit is contained in:
Jef Roosens 2022-09-05 10:10:02 +02:00
parent 3e0a2584fa
commit 7b59277931
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
4 changed files with 11 additions and 7 deletions

View file

@ -49,9 +49,9 @@ pub struct NewTarget {
}
// add_target adds a new target to the server.
pub fn (c &Client) add_target(t NewTarget) ?Response<string> {
pub fn (c &Client) add_target(t NewTarget) ?Response<int> {
params := models.params_from<NewTarget>(t)
data := c.send_request<string>(Method.post, '/api/v1/targets', params)?
data := c.send_request<int>(Method.post, '/api/v1/targets', params)?
return data
}