mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
improvement: accept number with - like 1399142-8988 and sanitize it in backend
This commit is contained in:
@@ -41,6 +41,7 @@ export const index = async (req: Request, res: Response): Promise<Response> => {
|
|||||||
|
|
||||||
export const store = async (req: Request, res: Response): Promise<Response> => {
|
export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||||
const newContact: ContactData = req.body;
|
const newContact: ContactData = req.body;
|
||||||
|
newContact.number = newContact.number.replace("-", "").replace(" ", "");
|
||||||
|
|
||||||
const schema = Yup.object().shape({
|
const schema = Yup.object().shape({
|
||||||
name: Yup.string().required(),
|
name: Yup.string().required(),
|
||||||
|
|||||||
Reference in New Issue
Block a user