Skip to content

Commit 220d080

Browse files
committed
test(rest): type the item read's query switches as string pairs
Claude-Session: https://claude.ai/code/session_01MRdbfpy4sQT8bUjmMhxsN7 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9e2a160 commit 220d080

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/rest/src/meta-type-read-capability.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ function typedReadDoors(rest: any): string[] {
173173
function readShapes(rest: any): Array<{ label: string; path: string; query: Record<string, string> }> {
174174
const shapes = typedReadDoors(rest).map((path) => ({ label: path.slice(META.length), path, query: {} as Record<string, string> }));
175175
const item = `${META}/:type/:name`;
176-
for (const query of [{ state: 'draft' }, { preview: 'draft' }, { layers: 'true' }, { package: 'crm' }]) {
177-
shapes.push({ label: `/:type/:name?${Object.keys(query)[0]}=${Object.values(query)[0]}`, path: item, query });
176+
const switches: Array<[string, string]> = [['state', 'draft'], ['preview', 'draft'], ['layers', 'true'], ['package', 'crm']];
177+
for (const [key, value] of switches) {
178+
shapes.push({ label: `/:type/:name?${key}=${value}`, path: item, query: { [key]: value } });
178179
}
179180
return shapes;
180181
}

0 commit comments

Comments
 (0)