adds reference to api interface as generic type arguments

This commit is contained in:
Seyi Adebajo 2018-01-22 16:09:38 -08:00
parent 5bca5a0550
commit cbe75c918e

View File

@ -1,4 +1,5 @@
import Base from 'ember-simple-auth/authenticators/base';
import { IAuthenticateResponse, IAuthenticationData } from 'wherehows-web/typings/api/authentication/user';
import { postJSON } from 'wherehows-web/utils/api/fetcher';
export default Base.extend({
@ -9,8 +10,8 @@ export default Base.extend({
* @param {string} password matching candidate password for username
* @return {Promise<{}>}
*/
authenticate: async (username: string, password: string): Promise<{}> => {
const { data } = await postJSON<{ data: {} }>({
authenticate: async (username: string, password: string): Promise<IAuthenticationData> => {
const { data } = await postJSON<IAuthenticateResponse>({
url: '/authenticate',
data: { username, password }
});