0
konvertiert ich diese Schnittstellen beschrieben:Kann nicht Antwort auf gültigen Typoskript Wert für strore
enum ProductType {current, closed, coming}
export interface CurrentProductForCarousel {
type_product:ProductType.current;
offers: ProductMainInfo[]
}
export interface ProductMainInfo {
id: number;
disclaimer: string;
company?: {
registeredOfficeState?: string;
};
date: {
timestamp: number;
days: number;
hours: number;
};
}
Ich habe NGRX-Speicher. Mein Minderer sieht aus wie
export interface State {
currentProductForCarousel: CurrentProductForCarousel | null;
}
export const initialState: State = {
сurrentProductForCarousel: null,
};
export function reducer(state = initialState, action:
pruduct.Actions): State {
switch (action.type) {
case pruductActions.FETCH_PRODUCTS_CURRENT_SUCCESS: {
return {
...state,
currentProductsForCarousel: action.payload,
};
}
Beispiel für die Antwort
{"success":true, "type_prudct":"current","products":[{"id":34, "disclaimer": "text", "company":{"registeredOfficeSuburb":"West Perth"}, "date":{"timestamp":1567987198,"days":710,"hours":"14"}}]}
Frage ist, wie ich Antwortdaten mit der richtigen Art von meiner Schnittstelle und als Daten aus Speicher erhalten speichern einstellen kann?