Huthaifa-Dev / project

Unnecessary concatenation of literals or template literals found JS-0096
Anti-pattern
Minor
a month ago2 years old
Unexpected string concatenation of literals
 85    try {
 86      const product = createProduct(data as Product);
 87      await axios.post(`${PRODUCTS_URL}` + ".json", product);
 88      const response = await axios.get(`${PRODUCTS_URL}` + ".json"); 89      const result = Object.keys(response.data).map((key) => {
 90        const product = response.data[key];
 91        product.id = key;
Unexpected string concatenation of literals
 84  async (data: Partial<Product>) => {
 85    try {
 86      const product = createProduct(data as Product);
 87      await axios.post(`${PRODUCTS_URL}` + ".json", product); 88      const response = await axios.get(`${PRODUCTS_URL}` + ".json");
 89      const result = Object.keys(response.data).map((key) => {
 90        const product = response.data[key];
Unexpected string concatenation of literals
 70      }
 71      console.log(product.data);
 72      const response = await axios.patch(
 73        `${PRODUCTS_URL}/${data.id}` + ".json", 74        product.data
 75      );
 76      return response.data;
Unexpected string concatenation of literals
 54  "categories/editProduct",
 55  async (data: { id: string; newProduct: Partial<Product> }) => {
 56    try {
 57      const product = await axios.get(`${PRODUCTS_URL}/${data.id}` + ".json"); 58      product.data = { ...data.newProduct };
 59      if (
 60        product.data.price !== undefined &&
Unexpected string concatenation of literals
 42  async (data: { body: string }) => {
 43    try {
 44      const response = await axios.delete(
 45        `${PRODUCTS_URL}/${data.body}` + ".json" 46      );
 47      return response.data;
 48    } catch (error) {