Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/controllers/customercontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,16 @@ async function findAndRespond(customerId, res) {
// customers — soft-deletes correctly surface as 404 too.
return res.status(404).json({ message: "Not found." });
}
// The historical key is `customers` (plural) wrapping a single
// customer — a wart from before the codebase standardized on
// singular-for-single-row across the other 15 entities. Add
// the consistent `customer` key alongside it so SDK clients
// can read the same shape they get from /v1/worker/:id et al.
// The `customers` key stays for backward compat; remove in a
// future major version.
return res.status(200).json({
message: "Successfully retrieved the customer with CustomerId " + customerId,
customer,
customers: customer,
});
} catch (error) {
Expand Down