verdnatura-chat/app/actions/createChannel.ts

43 lines
834 B
TypeScript
Raw Permalink Normal View History

import { Action } from 'redux';
import { CREATE_CHANNEL } from './actionsTypes';
// TODO FIX DATA VALUE
interface ICreateChannelRequest extends Action {
data: any;
}
interface ICreateChannelSuccess extends Action {
data: any;
}
interface ICreateChannelFailure extends Action {
err: any;
isTeam: boolean;
}
2022-01-10 21:05:12 +00:00
export type TActionCreateChannel = ICreateChannelRequest & ICreateChannelSuccess & ICreateChannelFailure;
export function createChannelRequest(data: any): ICreateChannelRequest {
return {
type: CREATE_CHANNEL.REQUEST,
data
};
}
export function createChannelSuccess(data: any): ICreateChannelSuccess {
return {
type: CREATE_CHANNEL.SUCCESS,
data
};
}
export function createChannelFailure(err: any, isTeam: boolean): ICreateChannelFailure {
return {
type: CREATE_CHANNEL.FAILURE,
err,
isTeam
};
}