Skip to content

Commit d2085eb

Browse files
authored
Merge pull request #313 from MultiSuperFreek/patch-1
Allow deleting notes
2 parents 6682305 + fe28755 commit d2085eb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Picqer/Financials/Moneybird/Actions/Noteable.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,23 @@ public function addNote(Note $note)
2828

2929
return $this;
3030
}
31+
32+
/**
33+
* Delete a note from the current object.
34+
*
35+
* @param Note|string $note Note object or note ID
36+
* @return $this
37+
*
38+
* @throws ApiException
39+
*/
40+
public function deleteNote(Note|string $note)
41+
{
42+
if (! is_string($note)) {
43+
$note = $note->id;
44+
}
45+
46+
$this->connection()->delete($this->getEndpoint() . '/' . urlencode($this->id) . '/notes/' . $note);
47+
48+
return $this;
49+
}
3150
}

0 commit comments

Comments
 (0)