Skip to content

Commit

Permalink
Merge pull request #43 from Piggy-Loyalty/fix/fix-custom-attribute-up…
Browse files Browse the repository at this point in the history
…dating

Fix custom attribute updating
  • Loading branch information
iDiegoNL authored Nov 8, 2024
2 parents 7f800b6 + 7af6aa6 commit 7c4c45f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Models/CustomAttributes/CustomAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ public static function create(array $body): CustomAttribute
*
* @throws MaintenanceModeException|GuzzleException|PiggyRequestException
*/
public static function update(array $body): CustomAttribute
public static function update(string $attributeName, array $body): CustomAttribute
{
$response = ApiClient::put(self::resourceUri, $body);
$response = ApiClient::put(self::resourceUri."/$attributeName", $body);

return CustomAttributeMapper::map($response->getData());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/OAuth/CustomAttributeResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function create(string $entity, string $name, string $label, string $type
* @param mixed[] $options
* @throws PiggyRequestException
*/
public function update(int $name, ?string $entity, ?string $label, ?array $options = null, ?string $description = null, ?string $groupName = null): CustomAttribute
public function update(string $name, ?string $entity, ?string $label, ?array $options = null, ?string $description = null, ?string $groupName = null): CustomAttribute
{
$response = $this->client->put("$this->resourceUri/$name", [
'entity' => $entity,
Expand Down

0 comments on commit 7c4c45f

Please sign in to comment.