Commit 320fefe6 by Nakarin Luankla

Merge branch 'DEV' of https://mygit.myhr.co.th/angular/myAppraisal into DEV

parents 61908d0c 8ed17eef
......@@ -26,12 +26,12 @@ import { HttpClientModule } from '@angular/common/http';
BrowserAnimationsModule,
StoreModule.forRoot({ data: dataReaducer }),
ToastrModule.forRoot(),
AngularFireModule,
// AngularFireModule,
AngularFireDatabaseModule,
AngularFirestoreModule,
AngularFireAuthModule,
LeafletModule,
AngularFireModule.initializeApp(environment.firebase),
// AngularFireModule.initializeApp(environment.firebase),
ColorPickerModule,
HttpClientModule
],
......
......@@ -59,22 +59,6 @@ export class LoginPageComponent {
this._error = { name: '', message: '' };
}
login() {
// this.disabled = "btn-loading"
this.clearErrorMessage();
if (this.validateForm(this.email, this.password)) {
this.authservice
.loginWithEmail(this.email, this.password)
.then(() => {
this.router.navigate(['/self-evaluation']);
console.clear();
})
.catch((_error: any) => {
this._error = _error;
this.router.navigate(['/']);
});
}
}
validateForm(email: string, password: string) {
if (email.length === 0) {
......
......@@ -35,9 +35,8 @@
<div class="flex justify-end">
<div class="px-1">
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name"
[(ngModel)]="search" (ngModelChange)="searchChange()">
<input type="text" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="search" (ngModelChange)="searchChange()">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
......@@ -183,7 +182,8 @@
<div class="w-full flex justify-end">
<div class="absolute flex">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md" (click)="clearData()">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
(click)="clearData()">
<svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00"
xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84"
transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
......@@ -322,8 +322,9 @@
</div>
<div class="flex justify-center mt-2rem mb-1rem space-x-4">
<button type="submit" class="ti-btn ti-btn-secondary"
data-hs-overlay="#company-registration-page-upload-modal" [class.ti-btn-disabled]="!selectedFile"
(click)="uploadFile()" [disabled]="!selectedFile" [disabled]="!selectedFile">
data-hs-overlay="#company-registration-page-upload-modal"
[class.ti-btn-disabled]="!selectedFile" (click)="uploadFile()" [disabled]="!selectedFile"
[disabled]="!selectedFile">
อัปโหลด
</button>
</div>
......
......@@ -138,6 +138,8 @@ import { GroupAssessmentService } from 'src/app/shared/services/group-assessment
import { GroupApproveService } from 'src/app/shared/services/group-approve.service';
import { UserService } from 'src/app/shared/services/user.service';
import { ManageUserComponent } from '../company-components/account-settings/manage-user/manage-user.component';
import { PmstypeService } from 'src/app/shared/services/pmstype.service';
import { PmstopicService } from 'src/app/shared/services/pmstopic.service';
export const MY_DATE_FORMATS = {
parse: {
......@@ -306,6 +308,8 @@ export class CustomDateAdapter extends NativeDateAdapter {
GroupAssessmentService,
GroupApproveService,
UserService,
PmstypeService,
PmstopicService,
{
provide: HTTP_INTERCEPTORS,
useClass: HttpRequestInterceptor,
......
.button-clear {
position: absolute;
top: 96px;
z-index: 1;
right: 41vw;
}
.button-help {
position: absolute;
top: 0px;
z-index: 1;
right: 0vw;
margin: 4.2rem;
margin-right: 10px; /* เพิ่มใหม่ 12/16*/
}
table.ti-custom-table thead {
height: 60px;
}
table.ti-custom-table thead th span {
font-size: 12px;
font-weight: bold;
}
.ti-custom-table td{
padding-left: 0.9rem;
padding-right: 1rem;
}
.ti-custom-table thead th:first-child {
width: 105px; /* ปรับความกว้างตามที่ต้องการ */
text-align: left; /* จัดตำแหน่งข้อความถ้าต้องการ */
}
.ti-custom-table thead th:last-child {
width: 150px; /* ปรับความกว้างตามที่ต้องการ */
}
a.custom-link {
padding: 10px 40px; /* ปรับ padding ให้เพิ่มขนาด */
}
/* สไตล์ของแถบเมนู */
.nav-tabs {
display: flex;
width: 100%;
cursor: pointer;
margin-bottom: 10px;
height: 20%;
}
.nav-item {
list-style: none;
margin-right: 10px; /* ช่องว่างระหว่างเมนู */
}
.nav-link {
text-decoration: none;
padding: 10px 20px;
display: inline-block;
font-size: large;
border-width: 2px 2px 0px 2px;
border-style: solid;
border-color: #ccc;
border-radius: 5px 5px 0px 0px;
}
.nav-link:hover {
background-color: #f0f0f0; /* เปลี่ยนสีเมื่อ hover */
}
.nav-link.active {
color: #ffffff; /* สีตัวอักษรในสถานะ active */
font-size: large;
border-bottom: 3.5px solid rgb(var(--color-primary)); /* เส้นใต้ */
background-color: rgb(var(--color-primary));
border-width: 2px 2px 0px 2px;
border-style: solid;
border-color: rgb(var(--color-primary));
border-radius: 5px 5px 0px 0px;
}
.tab-content {
margin-top: 20px;
}
.tab-pane.active {
display: block;
}
.nav-item-text {
list-style: none;
margin-right: 10px; /* ช่องว่างระหว่างเมนู */
}
.nav-link-text {
text-decoration: none;
display: inline-block;
font-size: large;
color: #569bf5;
border-bottom: 2px solid #569bf5;
line-height: 0.8;
}
.ti-pagination .page-link.active {
background-color: #569bf5;
color: white;
border-radius: 50%;
padding: 8px 12px;
}
.box-body{
padding: 0rem;
}
.page{
min-height: 0vh;
}
// .ti-modal-content {
// width: 70%;
// position: absolute;
// top: 50%;
// left: 50%;
// transform: translate(-50%, -50%);
// max-height: 90%; /* จำกัดความสูงให้อยู่ใน modal */
// overflow-y: auto; /* เปิดการเลื่อนแนวตั้ง */
// }
// .ti-modal-body-content {
// display: flex; /* ใช้ flexbox เพื่อจัดตำแหน่ง */
// justify-content: center; /* จัดฟอร์มให้อยู่กลางในแนวนอน */
// flex-direction: column; /* ทำให้ฟอร์มแสดงผลในรูปแบบคอลัมน์ */
// height: calc(100% - 50px); /* ให้ความสูงเป็น 100% ลบด้วยระยะห่างข้างบน */
// margin-left: calc(15% - 30px);
// margin-right: 20px;
// }
.ti-modal-content-alert{
width: 35%; /* ความกว้างที่คุณต้องการ */
position: absolute; /* ทำให้สามารถจัดตำแหน่งได้ */
top: 50%; /* ให้อยู่กลางในแนวตั้ง */
left: 50%; /* ให้อยู่กลางในแนวนอน */
transform: translate(-50%, -50%); /* เคลื่อนที่ modal กลับมาให้ตรงกลาง */
background-color: #ffffff;
}
// .header-title-type{
// width: 100%;
// height: 50px;
// margin-top: 10px;
// margin-bottom: 10px;
// }
.header-title-type {
width: 100%;
min-height: 50px; /* ใช้ min-height เพื่อให้มีความยืดหยุ่น */
// margin-top: 50px;
// margin-bottom: 10px;
justify-content: space-between; /* จัดเรียงองค์ประกอบภายใน */
align-items: center; /* จัดกลางแนวตั้ง */
padding-top: 50px;
padding-bottom: 1rem;
}
/* สไตล์ของแถบเมนู */
.nav-tabs {
display: flex;
border-bottom: 2px solid #ccc; /* เส้นใต้ */
border-top: 2px solid #ccc;
width: 100%;
cursor: pointer;
border-top: 2px solid #ccc;
}
.nav-item {
list-style: none;
margin-right: 40px; /* ช่องว่างระหว่างเมนู */
}
.nav-link {
text-decoration: none;
padding: 10px 20px;
display: inline-block;
font-size: medium;
text-align: left;
padding-left: 0px;
padding-right: 0px;
}
.nav-link:hover {
background-color: #f0f0f0; /* เปลี่ยนสีเมื่อ hover */
}
.nav-link.active {
color: #569bf5; /* สีตัวอักษรในสถานะ active */
font-size: medium;
border-bottom: 3.5px solid #569bf5; /* เส้นใต้ */
}
.tab-content {
margin-top: 20px;
}
.tab-pane.active {
display: block;
}
.body-content {
margin-left: 10px;
}
\ No newline at end of file
import { ChangeDetectorRef, Component } from '@angular/core';
export interface DataModel {
check: boolean,
code: string,
nameTypeTh: string,
nameTypeEn: string,
name: string
weight: string
}
import { ToastrService } from 'ngx-toastr';
import { MyPmstypeModel, PmstypeModel } from 'src/app/shared/model/pmstype.model';
import { FileService } from 'src/app/shared/services/file.service';
import { PmstypeService } from 'src/app/shared/services/pmstype.service';
@Component({
selector: 'app-assessment-types',
templateUrl: './assessment-types.component.html',
......@@ -21,91 +15,175 @@ export class AssessmentTypesComponent {
numDataListChecked = 0
isDataListChecked = false
isDataListCheckedAll = false
dataList: DataModel[] = [
{
check: false,
code: "01",
nameTypeTh: "การบริหารแบบแผนปัญญา",
nameTypeEn: "Hoshin Kanri Management",
name: "Hoshin",
weight: "1.2"
},
{
check: false,
code: "02",
nameTypeTh: "ตัวชี้วัดความสำเร็จ",
nameTypeEn: "Key Performance Indicator",
name: "KPI",
weight: "1.2"
},
{
check: false,
code: "03",
nameTypeTh: "การบริหารทีมงานข้ามสายงาน",
nameTypeEn: "Cross Functional Management",
name: "Cross Functional",
weight: "1.2"
},
{
check: false,
code: "04",
nameTypeTh: "กิจกรรมพิเศษ",
nameTypeEn: "Special Activities",
name: "Special Activities",
weight: "1.2"
}
]
dataSelect: DataModel = {
check: false,
code: "",
nameTypeTh: "",
nameTypeEn: "",
name: "",
weight: ""
pmstype: { loading: boolean, select: PmstypeModel, dataList: { check: boolean, data: PmstypeModel }[] } = { loading: false, select: new MyPmstypeModel(), dataList: [] }
modalStatus: "add" | "edit" | 'delete' | 'deleteGroup' = "add"
selectedFile: File | null = null;
selectedFileName: string = 'กรุณาเลือกไฟล์';
constructor(private cdr: ChangeDetectorRef,
private pmstypeService: PmstypeService,
private toastr: ToastrService,
private fileService: FileService
) {
}
modalStatus: "add" | "edit" = "add"
constructor(private cdr: ChangeDetectorRef) {
ngOnInit(): void {
this.getPmstypeList()
}
dataListSelect(data?: DataModel) {
this.dataSelect = data || {
check: false,
code: "",
nameTypeTh: "",
nameTypeEn: "",
name: "",
weight: ""
getPmstypeList() {
this.pmstype.loading = true
this.pmstypeService.getList().subscribe({
next: response => {
this.pmstype.dataList = response.map(x => ({ check: false, data: new MyPmstypeModel(x) }))
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.pmstype.loading = false
this.searchChange()
this.cdr.detectChanges()
}, error: error => {
this.pmstype.loading = false
this.cdr.detectChanges()
}
})
}
pmstypeListFilter() {
return this.pmstype.dataList.filter(x => {
const data = x.data
const match = data.pmsTypeId.toLowerCase().includes(this.search.toLowerCase()) ||
data.tdesc.toLowerCase().includes(this.search.toLowerCase()) ||
data.shortName.toLowerCase().includes(this.search.toLowerCase())
return match
})
}
selectPmstype(data?: PmstypeModel) {
this.pmstype.select = new MyPmstypeModel(data)
}
updatePmstype(typeApi: 'post' | 'delete') {
let body: PmstypeModel | PmstypeModel[]
switch (this.modalStatus) {
case ('delete'): {
body = [new MyPmstypeModel(this.pmstype.select)]
break;
}
case ('deleteGroup'): {
body = this.pmstype.dataList.filter(x => x.check).map(x => new MyPmstypeModel(x.data))
break;
}
default: {
body = new MyPmstypeModel(this.pmstype.select)
}
}
this.cdr.detectChanges()
this.pmstype.loading = true
this.pmstypeService[typeApi]((body as any)).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getPmstypeList()
this.searchChange()
} else {
this.showAlert(response.message, 'error')
this.pmstype.loading = false
}
this.cdr.detectChanges()
}, error: error => {
this.showAlert(error.message, 'error')
this.pmstype.loading = false
this.cdr.detectChanges()
}
})
}
dataListFilter() {
return this.dataList.filter(x => {
const match = x.code.includes(this.search) || x.nameTypeTh.includes(this.search) || x.nameTypeEn.includes(this.search);
if (!match) x.check = false;
return match;
});
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
})
}
dataListCheck() {
const dataCheck = this.dataListFilter();
this.isDataListChecked = dataCheck.some(x => x.check);
this.isDataListCheckedAll = dataCheck.length ? dataCheck.every(x => x.check) : false;
this.numDataListChecked = dataCheck.filter(x => x.check).length;
onFileSelected(event: any) {
this.selectedFile = event.target.files.length > 0 ? event.target.files[0] : null;
this.selectedFileName = this.selectedFile?.name || "กรุณาเลือกไฟล์"
}
uploadFile() {
if (!this.selectedFile) {
alert('กรุณาเลือกไฟล์ก่อนอัปโหลด')
return
}
const formData = new FormData();
formData.append('file', this.selectedFile);
this.pmstype.loading = true
this.fileService.uploadExcel(formData, '').subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getPmstypeList()
} else {
this.showAlert(response.message, 'error')
this.pmstype.loading = false
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.pmstype.loading = false
this.cdr.detectChanges()
}
})
}
downloadFile() {
const fileName = '.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({
next: response => {
const url = window.URL.createObjectURL(response);
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}, error: error => {
this.showAlert(error.message, 'error')
}
})
}
dataListCheckAll() {
const selectAll = this.isDataListCheckedAll;
this.dataList.forEach(x => x.check = selectAll);
this.pmstype.dataList.filter(x => {
const data = x.data
const match = data.pmsTypeId.toLowerCase().includes(this.search.toLowerCase()) ||
data.tdesc.toLowerCase().includes(this.search.toLowerCase()) ||
data.shortName.toLowerCase().includes(this.search.toLowerCase())
return match
}).forEach(x => x.check = selectAll);
this.dataListCheck();
}
dataListCheck() {
const dataCheck = this.pmstypeListFilter();
this.isDataListCheckedAll = dataCheck.length ? dataCheck.every(x => x.check) : false;
this.numDataListChecked = this.pmstype.dataList.filter(x => x.check).length;
this.isDataListChecked = Boolean(this.numDataListChecked)
}
clearPmstype(modalStatus: string) {
if (modalStatus == 'add') {
this.selectPmstype()
} else if (modalStatus == 'edit') {
this.selectPmstype(new MyPmstypeModel({ pmsTypeId: this.pmstype.select.pmsTypeId }))
}
}
searchChange() {
this.currentPage = 1;
const filteredData = this.dataListFilter();
this.page = Array.from({ length: Math.ceil(filteredData.length / 10) }, (_, i) => i + 1);
this.dataListCheck();
this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.pmstypeListFilter().length / 10) }, (_, i) => i + 1);
this.dataListCheck()
}
}
......@@ -11,22 +11,23 @@
<a class="font-size-16px font-weight-500 hs-tab-active:font-weight-700 hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 hover:text-secondary active"
href="javascript:void(0);" id="underline-item-1" data-hs-tab="#underline-1"
aria-controls="underline-1"
(click)="pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'ทะเบียนกำหนดชื่อ','ประเภทการประเมิน']">
(click)="currentPath=1;pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'ทะเบียนกำหนดชื่อ','ประเภทการประเมิน']">
ประเภทการประเมิน
</a>
<a class="font-size-16px font-weight-500 hs-tab-active:font-weight-700 hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 px-1 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 hover:text-secondary"
href="javascript:void(0);" id="underline-item-2" data-hs-tab="#underline-2"
aria-controls="underline-2"
(click)="pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'ทะเบียนกำหนดชื่อ','หัวข้อการประเมิน']">
(click)="currentPath=2;pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'ทะเบียนกำหนดชื่อ','หัวข้อการประเมิน']">
หัวข้อการประเมิน
</a>
</nav>
</div>
<div class="px-2rem pt-50px">
<div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
<div *ngIf="currentPath==1" id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
<app-assessment-types></app-assessment-types>
</div>
<div id="underline-2" class="hidden" role="tabpanel" aria-labelledby="underline-item-2">
<div *ngIf="currentPath==2" id="underline-2" class="hidden" role="tabpanel"
aria-labelledby="underline-item-2">
<app-assessment-topics></app-assessment-topics>
</div>
</div>
......
......@@ -7,4 +7,5 @@ import { Component } from '@angular/core';
})
export class NameRegistrationPerfomanceComponent {
pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'ทะเบียนกำหนดชื่อ', 'ประเภทการประเมิน']
currentPath = 1
}
import { MyPmstypeModel, PmstypeModel } from "./pmstype.model"
export interface PmstopicModel {
pmsTopicId: string
pmsType: PmstypeModel
companyId: string
lineNo: number
edesc: string
tdesc: string
indicatorsDetail: string
performanceGoalsDetail: string
weight: number
detailUnit: string
completionDate: string
targetAdetail: string
targetBdetail: string
targetCdetail: string
targetDdetail: string
targetFdetail: string
}
export class MyPmstopicModel implements PmstopicModel {
pmsTopicId: string
pmsType: PmstypeModel
companyId: string
lineNo: number
edesc: string
tdesc: string
indicatorsDetail: string
performanceGoalsDetail: string
weight: number
detailUnit: string
completionDate: string
targetAdetail: string
targetBdetail: string
targetCdetail: string
targetDdetail: string
targetFdetail: string
constructor(data?: Partial<PmstopicModel>) {
this.pmsTopicId = data?.pmsTopicId || ""
this.pmsType = new MyPmstypeModel(data?.pmsType)
this.companyId = data?.companyId || ""
this.lineNo = data?.lineNo ?? 0
this.edesc = data?.edesc || ""
this.tdesc = data?.tdesc || ""
this.indicatorsDetail = data?.indicatorsDetail || ""
this.performanceGoalsDetail = data?.performanceGoalsDetail || ""
this.weight = data?.weight ?? 0
this.detailUnit = data?.detailUnit || ""
this.completionDate = data?.completionDate || ""
this.targetAdetail = data?.targetAdetail || ""
this.targetBdetail = data?.targetBdetail || ""
this.targetCdetail = data?.targetCdetail || ""
this.targetDdetail = data?.targetDdetail || ""
this.targetFdetail = data?.targetFdetail || ""
}
}
export interface PmstypeModel {
pmsTypeId: string
companyId: string
edesc: string
tdesc: string
shortName: string
weight: number
}
export class MyPmstypeModel implements PmstypeModel {
pmsTypeId: string
companyId: string
edesc: string
tdesc: string
shortName: string
weight: number
constructor(data?: Partial<PmstypeModel>) {
this.pmsTypeId = data?.pmsTypeId || ""
this.companyId = data?.companyId || ""
this.edesc = data?.edesc || ""
this.tdesc = data?.tdesc || ""
this.shortName = data?.shortName || ""
this.weight = data?.weight ?? 0
}
}
......@@ -14,10 +14,7 @@ export class AuthService {
urlApi = environment.baseUrl + this.api
constructor(private afu: AngularFireAuth, private router: Router, private http: HttpClient) {
this.afu.authState.subscribe((auth: any) => {
this.authState = auth;
});
constructor( private router: Router, private http: HttpClient) {
}
refreshToken(): Observable<{ accessToken: string; refreshToken: string }> {
......@@ -56,32 +53,6 @@ export class AuthService {
}
}
registerWithEmail(email: string, password: string) {
return this.afu
.createUserWithEmailAndPassword(email, password)
.then((user: any) => {
this.authState = user;
})
.catch((_error: any) => {
console.log(_error);
throw _error;
});
}
loginWithEmail(email: string, password: string) {
return this.afu
.signInWithEmailAndPassword(email, password)
.then((user: any) => {
this.authState = user;
})
.catch((_error: any) => {
console.log(_error);
throw _error;
});
}
loginWithUserPass(username: string, password: string): Observable<{ accessToken: string ,refreshToken:string}> {
const body = {
username: username,
......@@ -92,8 +63,5 @@ export class AuthService {
logout(){
sessionStorage.clear()
}
singout(): void {
this.afu.signOut();
this.router.navigate(['/login']);
}
}
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AlertModel } from '../model/alert.model';
import { PmstopicModel } from '../model/pmstopic.model';
@Injectable({
providedIn: 'root'
})
export class PmstopicService {
api = "/pmstopic"
urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) {
}
getById(pmsTopicId: string): Observable<PmstopicModel> {
return this.http.get<PmstopicModel>(this.urlApi + "/" + pmsTopicId)
}
getList(): Observable<PmstopicModel[]> {
return this.http.get<PmstopicModel[]>(this.urlApi + "/lists")
}
post(body: PmstopicModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body)
}
delete(body: PmstopicModel | PmstopicModel[]): Observable<AlertModel> {
const options = {
headers: new HttpHeaders({
"Content-Type": "application/json",
}),
body: body
};
return this.http.delete<AlertModel>(this.urlApi, options)
}
}
\ No newline at end of file
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AlertModel } from '../model/alert.model';
import { PmstypeModel } from '../model/pmstype.model';
@Injectable({
providedIn: 'root'
})
export class PmstypeService {
api = "/pmstype"
urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) {
}
getById(pmsTypeId: string): Observable<PmstypeModel> {
return this.http.get<PmstypeModel>(this.urlApi + "/" + pmsTypeId)
}
getList(): Observable<PmstypeModel[]> {
return this.http.get<PmstypeModel[]>(this.urlApi + "/lists")
}
post(body: PmstypeModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body)
}
delete(body: PmstypeModel | PmstypeModel[]): Observable<AlertModel> {
const options = {
headers: new HttpHeaders({
"Content-Type": "application/json",
}),
body: body
};
return this.http.delete<AlertModel>(this.urlApi, options)
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment