signoz/frontend/src/api/user/getResetPasswordToken.ts
palash-signoz 59f32884d2
Feat(UI): Auth (#1018)
* auth and rbac frontend changes
2022-05-03 15:27:09 +05:30

25 lines
694 B
TypeScript

import axios from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError } from 'axios';
import { ErrorResponse, SuccessResponse } from 'types/api';
import { PayloadProps, Props } from 'types/api/user/getResetPasswordToken';
const getResetPasswordToken = async (
props: Props,
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
try {
const response = await axios.get(`/getResetPasswordToken/${props.userId}`);
return {
statusCode: 200,
error: null,
message: response.data.status,
payload: response.data,
};
} catch (error) {
return ErrorResponseHandler(error as AxiosError);
}
};
export default getResetPasswordToken;