Add skeletton for profile page
This commit is contained in:
31
frontend/src/app/Services/bot.service.ts
Normal file
31
frontend/src/app/Services/bot.service.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TokenStorageService } from './token.service';
|
||||
|
||||
const API_URL = 'https://gruppe1.testsites.info/api/';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class BotService {
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private tokenStorage: TokenStorageService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @param {string} telegramUserID
|
||||
* @returns Observable
|
||||
*/
|
||||
public createTransaction(telegram_user_id: string): Observable<any> {
|
||||
return this.http.post(API_URL + 'telegram', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
responseType: 'text',
|
||||
telegram_user_id,
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user