chore: format
This commit is contained in:
parent
78bf326622
commit
4aba99fcb5
@ -1,4 +1,4 @@
|
|||||||
export interface RegisterUserRequest{
|
export interface RegisterUserRequest {
|
||||||
name: string | null;
|
name: string | null;
|
||||||
email: string | null;
|
email: string | null;
|
||||||
mobile_number: string | null;
|
mobile_number: string | null;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { InjectionToken } from "@angular/core";
|
import { InjectionToken } from "@angular/core";
|
||||||
import {environment} from '../../../environments/environment';
|
import { environment } from "../../../environments/environment";
|
||||||
|
|
||||||
export const API_URL = new InjectionToken<string>('API_URL', {
|
export const API_URL = new InjectionToken<string>("API_URL", {
|
||||||
providedIn: "root",
|
providedIn: "root",
|
||||||
factory: () => environment.apiUrl
|
factory: () => environment.apiUrl,
|
||||||
})
|
});
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from "@angular/core/testing";
|
||||||
|
|
||||||
import { AuthService } from './auth-service';
|
import { AuthService } from "./auth-service";
|
||||||
|
|
||||||
describe('AuthService', () => {
|
describe("AuthService", () => {
|
||||||
let service: AuthService;
|
let service: AuthService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@ -10,7 +10,7 @@ describe('AuthService', () => {
|
|||||||
service = TestBed.inject(AuthService);
|
service = TestBed.inject(AuthService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it("should be created", () => {
|
||||||
expect(service).toBeTruthy();
|
expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from "@angular/core";
|
||||||
import { RegisterUserRequest } from '../../../core/models/user.model';
|
import { RegisterUserRequest } from "../../../core/models/user.model";
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from "@angular/common/http";
|
||||||
import { API_URL } from '../../../core/tokens/api-url-tokens';
|
import { API_URL } from "../../../core/tokens/api-url-tokens";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: "root",
|
||||||
})
|
})
|
||||||
export class AuthService {
|
export class AuthService {
|
||||||
|
|
||||||
private http: HttpClient = inject(HttpClient);
|
private http: HttpClient = inject(HttpClient);
|
||||||
private apiUrl = inject(API_URL);
|
private apiUrl = inject(API_URL);
|
||||||
|
|
||||||
@ -15,5 +14,4 @@ export class AuthService {
|
|||||||
console.log(this.apiUrl);
|
console.log(this.apiUrl);
|
||||||
return this.http.post(`${this.apiUrl}/register`, userRequest);
|
return this.http.post(`${this.apiUrl}/register`, userRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
apiUrl: 'http://localhost:8000/api',
|
apiUrl: "http://localhost:8000/api",
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
apiUrl: 'http://my-dev-url',
|
apiUrl: "http://my-dev-url",
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user