get sale
This commit is contained in:
		
							
								
								
									
										28
									
								
								static/js/sale.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								static/js/sale.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,28 @@
 | 
			
		||||
export function showInfo(api) {
 | 
			
		||||
    let token = localStorage.getItem("token");
 | 
			
		||||
    let id = window.location.pathname.split("/").pop();
 | 
			
		||||
 | 
			
		||||
    const requestOptions = {
 | 
			
		||||
        method: 'post',
 | 
			
		||||
        headers: {
 | 
			
		||||
            'Accept': `application/json`,
 | 
			
		||||
            'Content-Type': 'application/json',
 | 
			
		||||
            'Authorization': 'Bearer ' + token,
 | 
			
		||||
        },
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    fetch(api + "/api/admin/get-sale/" + id, requestOptions)
 | 
			
		||||
        .then(response => response.json())
 | 
			
		||||
        .then(function (data) {
 | 
			
		||||
            console.log(data);
 | 
			
		||||
        });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function formatCurrency(amount) {
 | 
			
		||||
    let c = parseFloat(amount/100);
 | 
			
		||||
    return c.toLocaleString("fr-FR", {
 | 
			
		||||
        style:"currency",
 | 
			
		||||
        currency: "EUR",
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user