return authActions.match(action, {
SAVE_API_TOKEN: (token: string) => {
return {...state, apiToken: token};
},
INIT: ({ user, token }) => {
return authActions.match(action, {
SAVE_API_TOKEN: (token: string) => {
return {...state, apiToken: token};
},
INIT: ({ user, token }) => {
return {...state, sshKeys};
},
ADD_SSH_KEY: (sshKey: SshKeyResource) => {
return {...state, sshKeys};
},
ADD_SSH_KEY: (sshKey: SshKeyResource) => {
- return { ...state, sshKeys: state.sshKeys!.concat(sshKey) };
+ return { ...state, sshKeys: state.sshKeys.concat(sshKey) };
+ },
+ REMOVE_SSH_KEY: (uuid: string) => {
+ return { ...state, sshKeys: state.sshKeys.filter((sshKey) => sshKey.uuid !== uuid )};