<commit_before>import {Component, Inject, Injectable, AfterViewInit, ViewChild, ElementRef} from '@angular/core';
import {MspApplication, Person} from '../../model/application.model';

import DataService from '../../service/msp-data.service';
import {MspApiService} from "../../service/msp-api.service";
import {Router} from "@angular/router";
import {ResponseType} from "../../api-model/responseTypes";

@Component({
  templateUrl: 'sending.component.html'
})
@Injectable()
export class SendingComponent implements AfterViewInit  {
  lang = require('./i18n');

  application:MspApplication;
  rawUrl: string;
  rawError: string;
  rawRequest: string;

  constructor(private dataService: DataService, private service:MspApiService, public router: Router) {
    this.application = this.dataService.getMspApplication();
  }

  ngAfterViewInit() {
    // After view inits, begin sending the application
    this.service
      .sendApplication(this.application)
      .then((application:MspApplication) => {
        this.application = application;

        //  go to confirmation
        this.router.navigateByUrl("/msp/application/confirmation");
      })
      .catch((error: ResponseType | any) => {
        this.rawUrl = error.url;
        this.rawError = error._body;
        this.rawRequest = error._requestBody
      });
  }
}<commit_msg>added reference call of logging.<commit_after>import {Component, Inject, Injectable, AfterViewInit, ViewChild, ElementRef} from '@angular/core';
import {MspApplication, Person} from '../../model/application.model';

import DataService from '../../service/msp-data.service';
import {MspApiService} from "../../service/msp-api.service";
import {Router} from "@angular/router";
import {ResponseType} from "../../api-model/responseTypes";
import {MspLogService} from '../../service/log.service'

@Component({
  templateUrl: 'sending.component.html'
})
@Injectable()
export class SendingComponent implements AfterViewInit {
  lang = require('./i18n');

  application: MspApplication;
  rawUrl: string;
  rawError: string;
  rawRequest: string;

  constructor(private dataService: DataService, private service: MspApiService, public router: Router, private logService: MspLogService) {
    this.application = this.dataService.getMspApplication();
  }

  ngAfterViewInit() {
    // After view inits, begin sending the application
    this.service
      .sendApplication(this.application)
      .then((application: MspApplication) => {
        this.application = application;
        this.logService.log({name: 'x', confirmationNumber: 'replaceMe'})
        //  go to confirmation
        this.router.navigateByUrl("/msp/application/confirmation");
      })
      .catch((error: ResponseType | any) => {
        this.rawUrl = error.url;
        this.rawError = error._body;
        this.rawRequest = error._requestBody
      });
  }
}
{'fraction_non_alphanumeric': 0.13672828740844087, 'fraction_numerical': 0.0013951866062085804, 'mean_word_length': 3.7016393442622952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1087377', 'n_tokens_mistral': 808, 'n_tokens_neox': 808, 'n_words': 186}