feat: replace the ssr/client data blocks with apis blocks
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -74,28 +74,12 @@ test("a bare body inside apis {} is a parse error naming response", () => {
|
||||
expect(() => parse(page(` bare GET /api/z { return data }`))).toThrow(/response/i);
|
||||
});
|
||||
|
||||
test("apis entry followed by an ssr api of the same name is rejected", () => {
|
||||
test("two apis entries of the same name across separate blocks are rejected", () => {
|
||||
const src = `page Repro {
|
||||
apis {
|
||||
foo GET /api/foo { response { return data } }
|
||||
}
|
||||
|
||||
ssr {
|
||||
api foo GET /api/foo { return data }
|
||||
}
|
||||
|
||||
view { <main>x</main> }
|
||||
}
|
||||
`;
|
||||
expect(() => parse(src)).toThrow(/duplicate/i);
|
||||
});
|
||||
|
||||
test("ssr api followed by an apis entry of the same name is rejected", () => {
|
||||
const src = `page Repro {
|
||||
ssr {
|
||||
api foo GET /api/foo { return data }
|
||||
}
|
||||
|
||||
apis {
|
||||
foo GET /api/foo { response { return data } }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user