2021-12-05 23:50:48 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Fluxor;
|
2021-12-04 00:44:02 +00:00
|
|
|
|
|
|
|
|
|
namespace Start.Client.Store.Features.CreateContainer {
|
|
|
|
|
public static class CreateContainerReducers {
|
|
|
|
|
[ReducerMethod(typeof(ShowCreateContainerFormAction))]
|
|
|
|
|
public static CreateContainerState ShowCreateContainerForm(CreateContainerState state) {
|
|
|
|
|
return state with {
|
|
|
|
|
ShowCreateContainerForm = true
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ReducerMethod(typeof(HideCreateContainerFormAction))]
|
|
|
|
|
public static CreateContainerState HideCreateContainerForm(CreateContainerState state) {
|
|
|
|
|
return state with {
|
|
|
|
|
ShowCreateContainerForm = false
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ReducerMethod(typeof(FetchCreateContainerAction))]
|
|
|
|
|
public static CreateContainerState FetchCreateContainer(CreateContainerState state) {
|
|
|
|
|
return state with {
|
|
|
|
|
IsLoadingCreateContainer = true
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ReducerMethod(typeof(ReceivedCreateContainerAction))]
|
|
|
|
|
public static CreateContainerState ReceivedCreateContainer(CreateContainerState state) {
|
|
|
|
|
return state with {
|
|
|
|
|
IsLoadingCreateContainer = false,
|
|
|
|
|
CreateContainerErrorMessage = null,
|
|
|
|
|
ShowCreateContainerForm = false
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ReducerMethod]
|
|
|
|
|
public static CreateContainerState ErrorFetchingCreateContainer(CreateContainerState state,
|
|
|
|
|
ErrorFetchingCreateContainerAction action) {
|
|
|
|
|
return state with {
|
|
|
|
|
IsLoadingCreateContainer = false,
|
|
|
|
|
CreateContainerErrorMessage = action.ErrorMessage
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|