-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* logout functionallity * logout functionallity format * merge temoate branch to logout_functionallity format * add logout * add logout gormat * remove forget pass and sc upload * remove forget pass and sc upload format * delete record query * delete record query fomat * remove base url * safe db call for remove user * safe db call for remove user fomat
- Loading branch information
1 parent
bc5c6e5
commit dae4533
Showing
35 changed files
with
193 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { UserRepository } from '../repository/user_repository' | ||
import { FutureUseCase } from './base/base_usecase' | ||
import { Params } from './base/params' | ||
|
||
export class LogoutUseCase extends FutureUseCase<LogoutParams, boolean> { | ||
private readonly userRepository: UserRepository | ||
constructor(repo: UserRepository) { | ||
super() | ||
this.userRepository = repo | ||
} | ||
async execute(params?: LogoutParams): Promise<boolean> { | ||
if (params?.verify()) { | ||
return await this.userRepository.logout({ | ||
email: params.email | ||
}) | ||
} else return false | ||
} | ||
} | ||
export class LogoutParams extends Params { | ||
readonly email?: string | ||
|
||
constructor(params?: { email: string }) { | ||
super({}) | ||
this.email = params.email | ||
} | ||
verify(): boolean { | ||
return true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export enum LOGOUT { | ||
request = 'LOGOUT_REQUEST', | ||
success = 'LOGOUT_SUCCESS', | ||
failure = 'LOGOUT_FAILURE' | ||
} | ||
|
||
export const logoutAction = params => ({ | ||
type: LOGOUT.request, | ||
params | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import data from 'packages/data/lib/data' | ||
import { Resource } from '../../utils/resource' | ||
import { LOGOUT } from './action' | ||
|
||
const logoutReducer = (initialState = Resource.none, action) => { | ||
switch (action.type) { | ||
case LOGOUT.request: | ||
return Resource.loading() | ||
|
||
case LOGOUT.success: | ||
return Resource.success({ | ||
data: action | ||
}) | ||
|
||
case LOGOUT.failure: | ||
return Resource.error({ | ||
error: 'User Not logged in' | ||
}) | ||
default: | ||
return initialState | ||
} | ||
} | ||
export default logoutReducer |
Oops, something went wrong.