text: import Axios from "axios";
  import { authenticationService } from "./auth.service";
  
  export const uploadService = {
    postGame,
    postImage,
    postSource
  };
  
  async function postGame(
    name,
    type,
    studioName,
    description,
    price,
    tags,
    imageLink,
    sourceLink
  ) {
    const header = {
      headers: {
        "Content-Type": "application/json"
      }
    };
  
    const body = {
      name: name,
      description: description,
      price: price,
      gameType: type,
      image: imageLink,
      source: sourceLink,
      author: authenticationService.currentUserValue._id,
      studio: studioName,
      tags: tags
    };
  
    let res = await Axios.post(
      "http://localhost:8084/products/post",
      body,
      header
    );
    return await res.data;
  }
  
  async function postImage(image) {
    let data = new FormData();
    data.append("image", image);
  
    let res = await Axios.post("http://localhost:8085/image/upload", data);
    return await res.data;
  }
  
  async function postSource(source) {
    let data = new FormData();
    data.append("source", source);
  
    let res = await Axios.post("http://localhost:8083/source/upload", data);
    return await res.data;
  }
  