fix(results): 🔒️ Improve delete security checks
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user