mirror of
https://github.com/directus/directus.git
synced 2026-01-28 14:28:02 -05:00
add updateByQuery to js sdk (#6824)
* add updateByQuery to js sdk https://github.com/directus/directus/discussions/6822 * Update items.ts
This commit is contained in:
@@ -65,6 +65,19 @@ export class ItemsHandler<T extends Item> implements IItems<T> {
|
||||
);
|
||||
}
|
||||
|
||||
async updateByQuery(updateQuery: QueryMany<T>, data: PartialItem<T>, query?: QueryMany<T>): Promise<ManyItems<T>> {
|
||||
return await this.transport.patch<PartialItem<T>[]>(
|
||||
`${this.endpoint}`,
|
||||
{
|
||||
query: updateQuery,
|
||||
data,
|
||||
},
|
||||
{
|
||||
params: query,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async deleteOne(id: ID): Promise<void> {
|
||||
await this.transport.delete(`${this.endpoint}/${encodeURI(id as string)}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user