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