This repository has been archived on 2025-06-18. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
casino/frontend/src/app/feature/game/dice/dice.service.ts
2025-05-21 09:06:29 +00:00

18 lines
520 B
TypeScript

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { DiceDto, DiceResult } from './dice.model';
import {environment} from "@environments/environment";
@Injectable({
providedIn: 'root',
})
export class DiceService {
private apiUrl = `${environment.apiUrl}/dice`;
constructor(private http: HttpClient) {}
rollDice(diceDto: DiceDto): Observable<DiceResult> {
return this.http.post<DiceResult>(this.apiUrl, diceDto);
}
}