This repository has been archived on 2026-05-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
chatless/frontend/src/app/services/message/message.service.ts
2021-05-29 14:41:07 +02:00

29 lines
630 B
TypeScript

import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {environment} from "../../../environments/environment";
export interface JSdata{
status: string;
data: any;
}
@Injectable({
providedIn: 'root'
})
export class MessageService {
constructor(private http: HttpClient) { }
sendMessage(url: string, data: any): Observable<JSdata> {
const CreatURL = environment.urlCL.concat('/').concat(url);
//console.log(CreatURL, data);
return this.http.post<JSdata>(
CreatURL,
data,
{withCredentials: true}
);
}
}