fix models
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
export interface SignalResponse {
|
||||
typ: 'arbete' | 'utbildning';
|
||||
omfattning: 'heltid' | 'deltid';
|
||||
omfattning_procent: number;
|
||||
startdatum: string;
|
||||
export enum SignalResponseType {
|
||||
Work = 'work',
|
||||
Education = 'education',
|
||||
}
|
||||
|
||||
export enum SignalResponseOmfattning {
|
||||
Heltid = 'heltid',
|
||||
Deltid = 'deltid',
|
||||
}
|
||||
|
||||
export interface SignalResponse {
|
||||
genomforandereferens: number;
|
||||
type: SignalResponseType;
|
||||
omfattning: SignalResponseOmfattning;
|
||||
omfattningPercent: number;
|
||||
startDate: string;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import { SignalResponse } from './api/signal.response.model';
|
||||
import { Signal } from '../../pages/deltagare/pages/deltagare-details/pages/report-forms/signal-form/signal-form.model';
|
||||
|
||||
export type Signal = SignalResponse;
|
||||
|
||||
export function mapResponseToSignal(data: SignalResponse): Signal {
|
||||
const { typ, startdatum, omfattning, omfattning_procent } = data;
|
||||
|
||||
return {
|
||||
type: typ,
|
||||
omfattning,
|
||||
percent: omfattning_procent,
|
||||
startDate: new Date(startdatum),
|
||||
};
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user