Skip to content

Commit

Permalink
Code smells 1
Browse files Browse the repository at this point in the history
  • Loading branch information
UO250825 committed May 3, 2022
1 parent 2abdb6b commit a05ac42
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
1 change: 0 additions & 1 deletion restapi/routes/users_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as mongodb from "mongodb";
import * as service from "../services/DB_manager";
import sanitizeHtml from "sanitize-html";
import User from "../models/user";
import Product from "../models/product";
var app = require("../server");

// GET (todos los productos)
Expand Down
17 changes: 1 addition & 16 deletions webapp/src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
import { User, Login, Order, Address, ShippingPriceResponse, OrderToPlace } from '../shared/shareddtypes';
import {Product} from '../shared/shareddtypes';

// export async function addUser(user:User):Promise<boolean>{
// const apiEndPoint= process.env.REACT_APP_API_URI || 'http://localhost:5000/api'
// let response = await fetch(apiEndPoint+'/users/add', {
// method: 'POST',
// headers: {'Content-Type':'application/json'},
// body: JSON.stringify({'name':user.name, 'email':user.email})
// });
// if (response.status===200)
// return true;
// else
// return false;
// }



export async function getUsers():Promise<User[]>{
const apiEndPoint= process.env.REACT_APP_API_URI || 'http://localhost:5000/api'
let response = await fetch(apiEndPoint+'/users/list');
Expand Down Expand Up @@ -51,7 +36,7 @@ export async function getOrdersByUser(user_id:string):Promise<Order[]>{
return response.json()
}

export async function getShippingPrice(address: Address, distributionCenterId:String):Promise<ShippingPriceResponse>{
export async function getShippingPrice(address: Address, distributionCenterId:string):Promise<ShippingPriceResponse>{
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
Expand Down

0 comments on commit a05ac42

Please sign in to comment.