Skip to content

Commit 2c31821

Browse files
committed
product endpoint fixes
1 parent f078678 commit 2c31821

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

src/Endpoints/Products.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function save(ProductData $data)
6666

6767
return $this->run(
6868
$id == null ? 'POST' : 'PUT',
69-
'pedidovenda-rest/pessoas'.($id > 0 ? '/'.$id : null),
69+
'operacional/produtos'.($id > 0 ? '/'.$id : null),
7070
['json' => $data->toArray()]
7171
);
7272
}
@@ -80,6 +80,16 @@ public function save(ProductData $data)
8080
*/
8181
public function delete($id)
8282
{
83-
return $this->run('DELETE', 'pedidovenda-rest/pessoas/'.$id);
83+
return $this->run('DELETE', 'operacional/produtos/'.$id);
84+
}
85+
86+
/**
87+
* Get the product price table info.
88+
*
89+
* @return ProductPriceTable
90+
*/
91+
public function priceTableInfo()
92+
{
93+
return new ProductPriceTable($this->client);
8494
}
8595
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace JulianoBailao\DomusApi\Endpoints\Secondary;
4+
5+
use JulianoBailao\DomusApi\Contracts\GetContract;
6+
use JulianoBailao\DomusApi\Core\Endpoint;
7+
8+
class ProductPriceTable extends Endpoint implements GetContract
9+
{
10+
/**
11+
* Get a page of models list.
12+
*
13+
* @param array $query the request query string.
14+
*
15+
* @return stdObject
16+
*/
17+
public function paginate(array $query = [])
18+
{
19+
return $this->page('pedidovenda-rest/produtos', $query);
20+
}
21+
22+
/**
23+
* Get a specific model.
24+
*
25+
* @param int $id the model id.
26+
*
27+
* @return stdObject
28+
*/
29+
public function get($id)
30+
{
31+
return $this->run('GET', 'pedidovenda-rest/produtos/'.$id);
32+
}
33+
}

0 commit comments

Comments
 (0)