clone contract UI

This commit is contained in:
glovetleong
2021-07-21 13:07:14 +08:00
parent f718ecb54f
commit 0d1bfa0188
13 changed files with 145 additions and 108 deletions
@@ -45,4 +45,11 @@ class ContractController extends BaseController
$contract = ContractModule::delete($request, $hash_id);
return $contract;
}
public function validCheck(Request $request, $hash_id = '')
{
$method = empty($hash_id) ? 'POST' :'PUT';
$valid = ContractModule::validCheck($request, $hash_id, $method);
return $valid;
}
}
+8
View File
@@ -230,6 +230,14 @@ class ContractModule extends BaseController
return response()->json($data);
}
public static function validCheck(Request $request, $hash_id = '', $method = 'POST')
{
$id = $hash_id ? Hasher::decode('contracts', $hash_id) : '';
$validation = ContractModule::validation($request, $id, $method);
if (!$validation->status) {
return response()->json($validation, 422);
}
}
private static function validation(Request $request, $id = '', $method = 'POST')
{