2
0

fix(results): 🔒️ Improve delete security checks

This commit is contained in:
Baptiste Arnaud
2022-06-18 09:41:23 +02:00
parent 4e6217597c
commit 9352587298
6 changed files with 25 additions and 24 deletions

View File

@ -76,10 +76,15 @@ export const useResults = ({
}
}
export const deleteResults = async (typebotId: string, ids: string[]) => {
export const deleteResults = async (
workspaceId: string,
typebotId: string,
ids: string[]
) => {
const params = stringify(
{
ids,
workspaceId,
},
{ indices: false }
)
@ -89,12 +94,6 @@ export const deleteResults = async (typebotId: string, ids: string[]) => {
})
}
export const deleteAllResults = async (typebotId: string) =>
sendRequest({
url: `/api/typebots/${typebotId}/results`,
method: 'DELETE',
})
export const getAllResults = async (workspaceId: string, typebotId: string) => {
const results = []
let hasMore = true