New file upload

This commit is contained in:
CHIEFSOFT\ameye
2024-06-25 15:34:29 -04:00
parent 0c24b7950a
commit 6aa561fed1
8 changed files with 150 additions and 216 deletions
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { MediaConnectService } from './media-connect.service';
describe('MediaConnectService', () => {
let service: MediaConnectService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(MediaConnectService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+58
View File
@@ -0,0 +1,58 @@
import { Injectable } from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { SessionDataProviderService } from '../store/session-data-provider.service';
import {Router} from "@angular/router";
import axios from "axios";
@Injectable({
providedIn: 'root'
})
export class MediaConnectService {
apiKey = '99dfe35fcb7de1ee';
url;
constructor(private http: HttpClient,
private router: Router,
public sessionDataProviderService :SessionDataProviderService) {
// this is test
this.url = 'https://dev-media.wrenchboard.com';
}
sendPostData(reqPath:string, reqData): Observable<any> {
let headers = new HttpHeaders({
'Content-Type': 'application/json',
/* 'Authorization': this.basic */});
let options = { headers: headers };
headers.append('Content-Type','multipart/form-data');
const apiReturn = this.http.post(
`${environment.baseMediaUrl}/${reqPath}`,reqData, { headers: headers}
);
// const apiReturn = this.http.post(
// `${environment.baseMediaUrl}/${reqPath}`,reqData
// );
console.log(reqData);
axios.post('https://dev-media.wrenchboard.com/upload/contract',reqData )
.then( res => {})
.catch(er => console.log(er))
return apiReturn;
}
uploadtaskFile(formData){
// debugger;
console.log("formData == > ", formData);
const pathUpload = "upload/contract";
return this.sendPostData(pathUpload, formData);
//
}
}
-129
View File
@@ -384,133 +384,4 @@ export class WrenchService {
uploadFile(uploadData){
return this.getPostData("/uploads", uploadData);
}
/*
registerUser(newUserData) {
// no session needed - will start the session
return this.http.post(this.url + '/createmobileuser', newUserData)
.map(res => res.json());
}
completeRegisterUser(newUserData) {
// no session needed - will start the session
return this.http.post(this.url + '/completemobileuser', newUserData)
.map(res => res.json());
}
startResetPassword(UserData) {
// no session needed - will start the session
return this.http.post(this.url + '/startresetpasword', UserData)
.map(res => res.json());
}
getStartData() {
return this.http.post(this.url + '/startjoblist', { limit: '10', page: '1' })
.map(res => res.json());
}
getJobsData() {
return this.http.post(this.url + '/getjobsdata', { limit: '20', page: '1' })
.map(res => res.json());
}
getPendingJobsData(userData: any) {
return this.http.post(this.url + '/getpendingjobs', userData)
.map(res => res.json());
}
getMessages(UserData) {
console.log("getMessages Called");
return this.http.post(this.url + '/message', UserData)
.map(res => res.json());
}
//JOBS
getActiveJobData(UserData) {
console.log("getActiveJobData Called");
return this.http.post(this.url + '/activejoblist', UserData)
.map(res => res.json());
}
getMyOffersJobData(UserData) {
console.log("getMyOffersJobData Called");
return this.http.post(this.url + '/offerslist', UserData)
.map(res => res.json());
}
//=========================================
getPaymentHx(UserData) {
console.log("getPaymentHx Called");
return this.http.post(this.url + '/paymenthx', UserData)
.map(res => res.json());
}
getOffersJobDataff() {
console.log("getOffersJobData Called");
return this.http.post(this.url + '/offerslist', { limit: '10', page: '1', sessionid: 'ADNGHGHGHGHGHGH', member_id: 1 })
.map(res => res.json());
}
getDashData(memberID, sessionID) {
// session required here
return this.http.post(this.url + '/dashdata', { sessionid: sessionID, member_id: memberID })
.map(res => res.json());
}
getUserAccount(memberID, sessionID) {
// account
return this.http.post(this.url + '/account', { sessionid: sessionID, member_id: memberID })
.map(res => res.json());
}
getProfile(memberID, sessionID) {
//loadprofile
return this.http.post(this.url + '/loadprofile', { sessionid: sessionID, member_id: memberID })
.map(res => res.json());
}
getUserBankList(UserData) {
console.log("getActiveJobData Called");
return this.http.post(this.url + '/mybanklist', UserData)
.map(res => res.json());
}
userSendMoneyt(SendMoneydata) {
console.log("userSendMoneyt Called");
return this.http.post(this.url + '/sendmoney', SendMoneydata)
.map(res => res.json());
}
sendMoneyFee(SendMoneydata) {
console.log("sendMoneyFee Called");
return this.http.post(this.url + '/sendmoneyfee', SendMoneydata)
.map(res => res.json());
}
sendJobInterest(SendJobInterestData) {
console.log("sendJobInterest Called");
return this.http.post(this.url + '/sendinterest', SendJobInterestData)
.map(res => res.json());
}
sendOfferInterest(SendJobInterestData) {
console.log("sendOfferInterest Called");
return this.http.post(this.url + '/sendofferinterest', SendJobInterestData)
.map(res => res.json());
}
sendJobInterestMessage(sendJobInterestMessage) {
console.log("sendJobInterestMessage Called");
return this.http.post(this.url + '/sendinterestmessage', sendJobInterestMessage)
.map(res => res.json());
}
getTaskMessage(taskData: any) {
console.log("getTaskMessage Called");
return this.http.post(this.url + '/taskmessage', taskData)
.map(res => res.json());
}
sendTaskMessage(taskMessage: any) {
console.log("sendTaskMessage Called");
return this.http.post(this.url + '/sendtaskmessage', taskMessage)
.map(res => res.json());
}
*/
}