-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add PetsRs link to shelter card (#302)
* feat: add PetsRs link to shelter card * Add style to link * refactor: simplify clear shelter name logic
- Loading branch information
1 parent
f7498f0
commit 551cfa2
Showing
4 changed files
with
64 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import axios from 'axios'; | ||
|
||
import { IPetsRsShelter } from './types'; | ||
|
||
const PetsRsShelterServices = { | ||
getByName: async (name: string): Promise<IPetsRsShelter> => { | ||
const { data } = await axios.get(`https://cms.petsrs.com.br/api/abrigos?filters[Nome][$containsi]=${name}`); | ||
return data?.data[0]; | ||
}, | ||
} | ||
|
||
export { PetsRsShelterServices }; |
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,18 @@ | ||
export interface Attributes { | ||
Nome: string; | ||
Endereco: string; | ||
Longitude: string; | ||
Latitude: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
publishedAt: string; | ||
Telefone: string | null; | ||
nome_responsavel: string | null; | ||
instagramUrl: string | null; | ||
observacao: string | null; | ||
} | ||
|
||
export interface IPetsRsShelter { | ||
id: number; | ||
attributes: Attributes; | ||
} |