add version delete/update restrictions
This commit is contained in:
parent
24b0bb3798
commit
8f909821b6
|
@ -262,7 +262,7 @@ class meta extends Repo_i {
|
|||
|
||||
$versionData = $st->fetch();
|
||||
|
||||
if( !is_array($versionData) ){
|
||||
if( !is_array($versionData) || $versionData["default"] == 1){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -306,6 +306,12 @@ class meta extends Repo_i {
|
|||
}
|
||||
|
||||
public function updateVersion(int $version, ?String $label, ?bool $default) : bool{
|
||||
|
||||
//you can't un-default a version, you have to choose another version to be the default one
|
||||
if($default == false){
|
||||
return false;
|
||||
}
|
||||
|
||||
$set = "";
|
||||
$execute = [];
|
||||
|
||||
|
|
Loading…
Reference in New Issue