only POST new/changed data to the API when saving (#2)
This commit is contained in:
parent
fe713f6926
commit
927e68f71b
@ -4,8 +4,10 @@ namespace JHodges\GiteaBot;
|
||||
class GiteaData{
|
||||
|
||||
protected $data=null;
|
||||
protected $newData=null;
|
||||
|
||||
public function __construct($data=null){
|
||||
$this->newData=new stdClass();
|
||||
if(!$data){
|
||||
$data=new stdClass();
|
||||
}
|
||||
@ -14,6 +16,7 @@ class GiteaData{
|
||||
|
||||
public function __set($k,$v){
|
||||
$this->data->$k=$v;
|
||||
$this->newData->$k=$v;
|
||||
}
|
||||
|
||||
public function __get($k){
|
||||
|
@ -15,7 +15,7 @@ class GiteaRepoData extends GiteaData{
|
||||
}
|
||||
|
||||
public function save(){
|
||||
return $this->repo->request($this->url,'PATCH',$this->data);
|
||||
return $this->repo->request($this->url,'PATCH',$this->newData);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user