mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 23:45:57 +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 (
|
export const saveFunnelDescription = async (
|
||||||
payload: UpdateFunnelDescriptionPayload,
|
payload: UpdateFunnelDescriptionPayload,
|
||||||
): Promise<SuccessResponse<FunnelData> | ErrorResponse> => {
|
): Promise<SuccessResponse<FunnelData> | ErrorResponse> => {
|
||||||
const response: AxiosResponse = await axios.post(
|
const response: AxiosResponse = await axios.put(
|
||||||
`${FUNNELS_BASE_PATH}/save`,
|
`${FUNNELS_BASE_PATH}/${payload.funnel_id}`,
|
||||||
payload,
|
payload,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -142,6 +142,7 @@ export const useValidateFunnelSteps = ({
|
|||||||
interface SaveFunnelDescriptionPayload {
|
interface SaveFunnelDescriptionPayload {
|
||||||
funnel_id: string;
|
funnel_id: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
timestamp: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useSaveFunnelDescription = (): UseMutationResult<
|
export const useSaveFunnelDescription = (): UseMutationResult<
|
||||||
@ -149,7 +150,11 @@ export const useSaveFunnelDescription = (): UseMutationResult<
|
|||||||
Error,
|
Error,
|
||||||
SaveFunnelDescriptionPayload
|
SaveFunnelDescriptionPayload
|
||||||
> =>
|
> =>
|
||||||
useMutation({
|
useMutation<
|
||||||
|
SuccessResponse<FunnelData> | ErrorResponse,
|
||||||
|
Error,
|
||||||
|
SaveFunnelDescriptionPayload
|
||||||
|
>({
|
||||||
mutationFn: saveFunnelDescription,
|
mutationFn: saveFunnelDescription,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ function AddFunnelDescriptionModal({
|
|||||||
{
|
{
|
||||||
funnel_id: funnelId,
|
funnel_id: funnelId,
|
||||||
description,
|
description,
|
||||||
|
timestamp: Date.now(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user