This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from django.core.management import BaseCommand | |
from django.utils import timezone | |
from products.models import ProductCategory, Product | |
class Command(BaseCommand): | |
help = "Loads products and product categories from CSV file." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const api = axios.create({baseURL: 'https://api.backend.com'}) | |
api.interceptors.response.use( | |
response => response, | |
error => { | |
if (error.response.data.message) { | |
error.message = error.response.data.message | |
} | |
return Promise.reject(error) | |
}, | |
) |