Skip to content

Commit

Permalink
DELETE
Browse files Browse the repository at this point in the history
  • Loading branch information
Attila Németh committed Jan 3, 2021
1 parent 016c18a commit bfdaea5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@attus/drupal",
"version": "11.0.0",
"version": "11.1.0",
"description": "Drupal Service",
"homepage": "https://github.com/attus74/drupal",
"author": "Attila Németh",
Expand Down
1 change: 1 addition & 0 deletions src/lib/drupal.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { HttpClientModule } from '@angular/common/http';
import { DrupalComponent } from './drupal.component';
import { DrupalService } from './drupal.service';

// @dynamic
@NgModule({
declarations: [DrupalComponent],
imports: [
Expand Down
13 changes: 10 additions & 3 deletions src/lib/drupal.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export class DrupalService {
@Inject('DRUPAL_TOKEN_SERVICE') private tokenService: DrupalTokenService,
@Inject('DRUPAL_CONFIG') private drupalConfig: DrupalConfig) { }

async initialize(): Promise<any> {
console.info('Drupal Service wurde initialisiert');
return this.refreshToken();
initialize() {
this.refreshToken();
return() => console.info('Drupal Service wurde initialisiert');
}

login(username: string, password: string): void {
Expand Down Expand Up @@ -86,6 +86,13 @@ export class DrupalService {
);
}

delete(path: string, data: any, options?: DrupalHttpOptions): Observable<any> {
return this.http.delete(this.drupalConfig.url + '/' + path, options).pipe(
timeout(24000),
catchError(this.formatErrors),
);
}

private refreshToken(): void {
this.tokenService.getRefreshToken().then(token => {
if (token === null) {
Expand Down

0 comments on commit bfdaea5

Please sign in to comment.