Skip to content

Commit

Permalink
Use new api url
Browse files Browse the repository at this point in the history
  • Loading branch information
angelguzmaning committed Nov 8, 2021
1 parent 59efcd2 commit 3bdb406
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/config/settings.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default {
baseApiUrl: 'https://conduit.productionready.io/api/',
baseApiUrl: 'https://api.realworld.io/api/',
};
2 changes: 1 addition & 1 deletion src/services/conduit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function login(email: string, password: string): Promise<Result<Use
const { data } = await axios.post('users/login', { user: { email, password } });

return Ok(guard(object({ user: userDecoder }))(data).user);
} catch ({ data }) {
} catch ({ response: { data } }) {
return Err(guard(object({ errors: genericErrorsDecoder }))(data).errors);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/types/profile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Decoder, string, nullable, boolean, object } from 'decoders';
import { Decoder, string, nullable, boolean, object, hardcoded, either } from 'decoders';
import { PublicUser } from './user';

export interface Profile extends PublicUser {
Expand All @@ -9,5 +9,5 @@ export const profileDecoder: Decoder<Profile> = object({
username: string,
bio: nullable(string),
image: nullable(string),
following: boolean,
following: either(boolean, hardcoded(false)),
});

0 comments on commit 3bdb406

Please sign in to comment.