def delete(self, request: HttpRequest): branch_json = json.loads(request.POST.get("branch_json")) branch_object: BranchModel = BranchModel() branch_object.branchid = branch_json.get("branchid") branch_object.name = branch_json.get("name") branch_object.code = branch_json.get("code") branch_service: BranchService = BranchService() branch_object = branch_service.delete(branch_object) return self.send_response(branch_object)
def get(self, request: HttpRequest): params = [{ "id": RequestConfig(from_session=False, nullable=False, datatype=DataTypes.INT) }] params: ParamsObject = self.convert_params(request, HttpMethodType.get, params) branch_service: BranchService = BranchService() data = branch_service.get(params) return self.send_response(data)