fix typos

This commit is contained in:
2019-01-21 18:31:43 +03:00
parent c072c7f7fc
commit 42ca9cdbcd
2 changed files with 16 additions and 17 deletions

View File

@@ -1,5 +1,4 @@
import { Action } from "redux";
import { IUserAuthJSON } from "~../../src/entity/User";
export enum AuthTypes {
@@ -10,7 +9,7 @@ export enum AuthTypes {
AUTH_START_FORM_SPINNER = "AUTH_START_FORM_SPINNER",
}
export interface IAuthStartActionAction extends Action {
export interface IAuthStartAction extends Action {
type: AuthTypes.AUTH_START;
payload: {
username: string;
@@ -18,7 +17,7 @@ export interface IAuthStartActionAction extends Action {
};
}
export interface ISignupStartActionAction extends Action {
export interface ISignupStartAction extends Action {
type: AuthTypes.SIGNUP_START;
payload: {
username: string;
@@ -27,12 +26,12 @@ export interface ISignupStartActionAction extends Action {
};
}
export interface IAuthSuccessActionAction extends Action {
export interface IAuthSuccessAction extends Action {
type: AuthTypes.AUTH_SUCCESS;
payload: IUserAuthJSON;
}
export interface IAuthFailureActionAction extends Action {
export interface IAuthFailureAction extends Action {
type: AuthTypes.AUTH_FAIL;
payload: {
error: string;
@@ -50,7 +49,7 @@ export function startFormSpinner(): IAuthStartFormSpinnerAction {
export function authStart(
username: string,
password: string,
): IAuthStartActionAction {
): IAuthStartAction {
return { type: AuthTypes.AUTH_START, payload: { username, password } };
}
@@ -58,24 +57,24 @@ export function signupStart(
username: string,
password: string,
email: string,
): ISignupStartActionAction {
): ISignupStartAction {
return {
type: AuthTypes.SIGNUP_START,
payload: { username, password, email },
};
}
export function authSuccess(user: IUserAuthJSON): IAuthSuccessActionAction {
export function authSuccess(user: IUserAuthJSON): IAuthSuccessAction {
return { type: AuthTypes.AUTH_SUCCESS, payload: user };
}
export function authFail(error: string): IAuthFailureActionAction {
export function authFail(error: string): IAuthFailureAction {
return { type: AuthTypes.AUTH_FAIL, payload: { error } };
}
export type AuthAction =
| IAuthStartActionAction
| IAuthSuccessActionAction
| IAuthFailureActionAction
| IAuthStartAction
| IAuthSuccessAction
| IAuthFailureAction
| IAuthStartFormSpinnerAction
| ISignupStartActionAction;
| ISignupStartAction;

View File

@@ -14,8 +14,8 @@ import {
authFail,
authSuccess,
AuthTypes,
IAuthStartActionAction,
ISignupStartActionAction,
IAuthStartAction,
ISignupStartAction,
startFormSpinner,
} from "./actions";
@@ -24,7 +24,7 @@ function* startSpinner() {
yield put(startFormSpinner());
}
function* authStart(action: IAuthStartActionAction) {
function* authStart(action: IAuthStartAction) {
const { username, password } = action.payload;
try {
const spinner = yield fork(startSpinner);
@@ -51,7 +51,7 @@ function* authStart(action: IAuthStartActionAction) {
}
}
function* signupStart(action: ISignupStartActionAction) {
function* signupStart(action: ISignupStartAction) {
const { username, password, email } = action.payload;
try {
const spinner = yield fork(startSpinner);