frontend


frontend / api/inventory/itemMutations / renameItem

Function: renameItem()

renameItem(req): Promise<UpsertItemResponse>

Defined in: src/api/inventory/itemMutations.ts:85

Rename an inventory item (change item name). Only ADMIN users can rename items.

Parameters

req

Rename payload with item id and new name

id

string

newName

string

Returns

Promise<UpsertItemResponse>

Response object with ok status, normalized item, and optional error

Note

Backend validates that the new name is not a duplicate for the same supplier

Note

ADMIN-only operation

Example

const result = await renameItem({
  id: 'ITEM-123',
  newName: 'Updated Widget Name'
});