mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 20:15:56 +08:00
refactor: update funnel description endpoint from POST /save to PUT /{funnel_id} (#8080)
* refactor: update funnel description endpoint from POST /save to PUT /{funnel_id} * feat: add timestamp to funnel description payload and update mutation type --------- Co-authored-by: Shivanshu Raj Shrivastava <shivanshu1333@gmail.com>
This commit is contained in:
parent
440c3d8386
commit
c58cf67eb0
@ -167,8 +167,8 @@ interface UpdateFunnelDescriptionPayload {
|
||||
export const saveFunnelDescription = async (
|
||||
payload: UpdateFunnelDescriptionPayload,
|
||||
): Promise<SuccessResponse<FunnelData> | ErrorResponse> => {
|
||||
const response: AxiosResponse = await axios.post(
|
||||
`${FUNNELS_BASE_PATH}/save`,
|
||||
const response: AxiosResponse = await axios.put(
|
||||
`${FUNNELS_BASE_PATH}/${payload.funnel_id}`,
|
||||
payload,
|
||||
);
|
||||
|
||||
|
@ -142,6 +142,7 @@ export const useValidateFunnelSteps = ({
|
||||
interface SaveFunnelDescriptionPayload {
|
||||
funnel_id: string;
|
||||
description: string;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export const useSaveFunnelDescription = (): UseMutationResult<
|
||||
@ -149,7 +150,11 @@ export const useSaveFunnelDescription = (): UseMutationResult<
|
||||
Error,
|
||||
SaveFunnelDescriptionPayload
|
||||
> =>
|
||||
useMutation({
|
||||
useMutation<
|
||||
SuccessResponse<FunnelData> | ErrorResponse,
|
||||
Error,
|
||||
SaveFunnelDescriptionPayload
|
||||
>({
|
||||
mutationFn: saveFunnelDescription,
|
||||
});
|
||||
|
||||
|
@ -41,6 +41,7 @@ function AddFunnelDescriptionModal({
|
||||
{
|
||||
funnel_id: funnelId,
|
||||
description,
|
||||
timestamp: Date.now(),
|
||||
},
|
||||
{
|
||||
onSuccess: () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user