Return newly added customer note as array in API response
- Updated `addNote` in `users_o` to return the `customer_notes_o` object. - Modified `customerNotes` endpoint to include note details in the success response. - Introduced `asArray` method in `customer_notes_o` for structured API responses.
This commit is contained in:
@@ -389,13 +389,14 @@ class users_o extends db
|
||||
return $customer_notes->getCustomerNotesAsArray($this->id);
|
||||
}
|
||||
|
||||
public function addNote($customer_id, $note, $cashier_id): void
|
||||
public function addNote($customer_id, $note, $cashier_id): customer_notes_o
|
||||
{
|
||||
global $db;
|
||||
// Create the customer notes object
|
||||
$customer_notes = new customer_notes_o();
|
||||
// Add the note
|
||||
$customer_notes->add($customer_id, $note, $cashier_id);
|
||||
return $customer_notes;
|
||||
}
|
||||
|
||||
public function deleteNote(int $note_id): void
|
||||
|
||||
Reference in New Issue
Block a user