gi-nx / patchProperties
ts
const patchProperties: (projects: ProjectFeatureCollection, newProps: (f: Feature) => Record<string, number | string | boolean>) => Promise<void[]>;Patch properties on multiple projects.
Parameters
| Parameter | Type | Description |
|---|---|---|
projects | ProjectFeatureCollection | FeatureCollection of projects to update |
newProps | (f: Feature) => Record<string, number | string | boolean> | Function that returns new properties for each feature |
Returns
Promise<void[]>
Promise that resolves when all patches are complete
Throws
Error if any feature ID doesn't match an existing project
Needs Permission
Example
typescript
const projects = await rpc.invoke("getProjects", []);
await rpc.invoke("patchProperties", [
projects,
(feature) => ({ status: "reviewed", reviewDate: Date.now() })
]);