Ajout d'un reset des stats de l'utilisateur

après l'ajout ou la suppression de sauts.
This commit is contained in:
Sébastien André
2021-08-14 23:16:11 +02:00
parent ce6dad44ce
commit cb63dc8995
4 changed files with 15 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ export class ServiceCacheApi {
}
public get<T>(key: CacheApiKey, callToApi: Observable<T>) : Observable<T> {
console.log(`Get/push cache : ${CacheApiKey[key]}`);
// console.log(`Get/push cache : ${CacheApiKey[key]}`);
const cached = this.cache.get(key);
if (cached) {
@@ -29,12 +29,12 @@ export class ServiceCacheApi {
}
public delete(key: CacheApiKey) {
console.log(`Delete cache : ${CacheApiKey[key]}`);
// console.log(`Delete cache : ${CacheApiKey[key]}`);
this.cache.delete(key);
}
public getByKey<T>(key: CacheApiKey) : Observable<T> {
console.log(`Get cache by key : ${CacheApiKey[key]}`);
// console.log(`Get cache by key : ${CacheApiKey[key]}`);
return this.cache.get(key);
}
}

View File

@@ -37,6 +37,10 @@ export class StatsService extends BaseService {
this.serviceCacheApi.delete(CacheApiKey.StatsOfLastMonth);
}
public resetStats() {
this.http.get(`${this.apiUrl}/Stats/Reset`, { headers: this.headers }).subscribe();
}
public getSimpleSummary(): Observable<SimpleSummary> {
let callToApi = this.http.get<SimpleSummaryResp>(`${this.apiUrl}/Stats/Simple`, { headers: this.headers })
.pipe(map(response => {