Interim commit for async/await

This commit is contained in:
oitsjustjose 2021-07-02 20:31:20 -05:00
commit fc4d1aa5f4
8 changed files with 65 additions and 37 deletions

View file

@ -1,3 +1,10 @@
import axios from 'axios';
export default (slug) => axios.get(`/c/${slug}`).then((resp) => resp.data);
export default async (slug) => {
try {
const resp = await axios.get(`/c/${slug}`);
return resp.data;
} catch {
return null;
}
};