Interim commit for async/await
This commit is contained in:
parent
3fd340d14d
commit
fc4d1aa5f4
8 changed files with 65 additions and 37 deletions
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue