mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-18 11:31:12 -05:00
fix: action cacheClass cache not getting revalidation after deleting (#2188)
This commit is contained in:
3
apps/web/.gitignore
vendored
3
apps/web/.gitignore
vendored
@@ -42,4 +42,5 @@ next-env.d.ts
|
||||
token.json
|
||||
|
||||
# Local Uploads
|
||||
uploads/
|
||||
uploads/
|
||||
certificates
|
||||
@@ -224,7 +224,7 @@ export default function AddNoCodeActionModal({
|
||||
Cancel
|
||||
</Button>
|
||||
<Button variant="darkCTA" type="submit" loading={isCreatingAction}>
|
||||
Track Action
|
||||
Create Action
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -275,7 +275,7 @@ export default function AddNoCodeActionModal({
|
||||
Cancel
|
||||
</Button>
|
||||
<Button variant="darkCTA" type="submit" loading={isCreatingAction}>
|
||||
Track Action
|
||||
Create Action
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,7 +36,7 @@ const createNoCodeActionByCSSSelector = async (
|
||||
// User fills the CSS Selector to track
|
||||
await expect(page.locator("[name='noCodeConfig.cssSelector.value']")).toBeVisible();
|
||||
await page.locator("[name='noCodeConfig.cssSelector.value']").fill(selector);
|
||||
await page.getByRole("button", { name: "Track Action", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Create Action", exact: true }).click();
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
};
|
||||
@@ -88,8 +88,8 @@ const createNoCodeActionByPageURL = async (
|
||||
// User clicks the Test Match button
|
||||
await page.getByRole("button", { name: "Test Match", exact: true }).click();
|
||||
|
||||
// User clicks the Track Action button
|
||||
await page.getByRole("button", { name: "Track Action", exact: true }).click();
|
||||
// User clicks the Create Action button
|
||||
await page.getByRole("button", { name: "Create Action", exact: true }).click();
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
};
|
||||
@@ -127,7 +127,7 @@ const createNoCodeActionByInnerText = async (
|
||||
// User fills the Inner Text to track
|
||||
await expect(page.locator("[name='noCodeConfig.innerHtml.value']")).toBeVisible();
|
||||
await page.locator("[name='noCodeConfig.innerHtml.value']").fill(innerText);
|
||||
await page.getByRole("button", { name: "Track Action", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Create Action", exact: true }).click();
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
};
|
||||
@@ -293,7 +293,7 @@ test.describe("Create and Edit Code Action", async () => {
|
||||
await expect(page.getByLabel("Description")).toBeVisible();
|
||||
await page.getByLabel("Description").fill(actions.create.code.description);
|
||||
|
||||
await page.getByRole("button", { name: "Track Action", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Create Action", exact: true }).click();
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
});
|
||||
|
||||
@@ -128,20 +128,21 @@ export const deleteActionClass = async (
|
||||
validateInputs([environmentId, ZId], [actionClassId, ZId]);
|
||||
|
||||
try {
|
||||
const result = await prisma.actionClass.delete({
|
||||
const actionClass = await prisma.actionClass.delete({
|
||||
where: {
|
||||
id: actionClassId,
|
||||
},
|
||||
select,
|
||||
});
|
||||
if (result === null) throw new ResourceNotFoundError("Action", actionClassId);
|
||||
if (actionClass === null) throw new ResourceNotFoundError("Action", actionClassId);
|
||||
|
||||
actionClassCache.revalidate({
|
||||
environmentId,
|
||||
id: actionClassId,
|
||||
name: actionClass.name,
|
||||
});
|
||||
|
||||
return result;
|
||||
return actionClass;
|
||||
} catch (error) {
|
||||
throw new DatabaseError(
|
||||
`Database error when deleting an action with id ${actionClassId} for environment ${environmentId}`
|
||||
|
||||
Reference in New Issue
Block a user