Skip to content

Commit 71c622f

Browse files
author
Benjamin Krammel
committed
DEV-7471
1 parent 3b3ade5 commit 71c622f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Service/RedirectService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function update(Redirect $body)
153153

154154
Domainrobot::setLastDomainrobotResult($domainrobotResult);
155155

156-
return new Contact(ArrayHelper::getValueFromArray($domainrobotResult->getResult(), 'data.0', []));
156+
return new Redirect(ArrayHelper::getValueFromArray($domainrobotResult->getResult(), 'data.0', []));
157157
}
158158

159159
/**
@@ -164,12 +164,12 @@ public function update(Redirect $body)
164164
*/
165165
public function updateAsync(Redirect $body)
166166
{
167-
if ($body->getId() === null) {
168-
throw new \InvalidArgumentException("Field Redirect.id is missing.");
167+
if ($body->getSource() === null) {
168+
throw new \InvalidArgumentException("Field Redirect.source is missing.");
169169
}
170170

171171
return $this->sendRequest(
172-
$this->domainrobotConfig->getUrl() . "/redirect/" . $body->getId(),
172+
$this->domainrobotConfig->getUrl() . "/redirect/" . $body->getSource(),
173173
'PUT',
174174
["json" => $body->toArray()]
175175
);

0 commit comments

Comments
 (0)