Remove double quote(")s in alert and success message

Viewed 25

I have fetch data using axios.

action.js

export const addUser =
  (user) => (dispatch, getState) => {
    axios
      .post(
        `${process.env.NEXT_PUBLIC_REMOTE_URL}/api/v1/users.json`,
        {
          user,
        },
        tokenConfig(getState),
      )
      .then((res) => {
        dispatch(setShowModal(false))
        dispatch(
          returnAlerts(
            'User created successfully',
            res.status,
          ),
        )
      })
      .catch((err) => {
        dispatch(returnErrors('Failed to create user'))
      })
  }

The success message shown in double codes ". Alert message as well in double quotes. It displays as "Failed to create user". How can I remove double quotes "?

0 Answers
Related