fix(housekeeping): preserve banner server actions
This commit is contained in:
1 parent
9c4b973faf
commit
bfc5bd78a1
2 files changed
+31
-1
No files matched your search
@@ -1,3 +1,25 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
export { createBanner, deleteBanner, updateBanner } from "./banners";
|
import {
|
||||||
|
createBanner as createBannerAction,
|
||||||
|
deleteBanner as deleteBannerAction,
|
||||||
|
updateBanner as updateBannerAction,
|
||||||
|
} from "./banners";
|
||||||
|
|
||||||
|
export async function createBanner(
|
||||||
|
input: Parameters<typeof createBannerAction>[0],
|
||||||
|
) {
|
||||||
|
return createBannerAction(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateBanner(
|
||||||
|
input: Parameters<typeof updateBannerAction>[0],
|
||||||
|
) {
|
||||||
|
return updateBannerAction(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteBanner(
|
||||||
|
input: Parameters<typeof deleteBannerAction>[0],
|
||||||
|
) {
|
||||||
|
return deleteBannerAction(input);
|
||||||
|
}
|
||||||
@@ -344,4 +344,12 @@ describe("Content legacy wrappers", () => {
|
|||||||
expect(source).toContain('from "@/actions/admin-banners"');
|
expect(source).toContain('from "@/actions/admin-banners"');
|
||||||
expect(source).not.toContain('from "@/actions/banners"');
|
expect(source).not.toContain('from "@/actions/banners"');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("exports explicit async banner wrappers accepted by Next server actions", () => {
|
||||||
|
const source = readFileSync("src/actions/admin-banners.ts", "utf8");
|
||||||
|
expect(source).not.toMatch(/export\s*\{/u);
|
||||||
|
for (const action of ["createBanner", "updateBanner", "deleteBanner"]) {
|
||||||
|
expect(source).toContain(`export async function ${action}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user