mirror of https://github.com/ethereum/go-ethereum
parent
d07464b8b0
commit
01c6252754
@ -0,0 +1,11 @@ |
|||||||
|
import { LAST_COMMIT_BASE_URL } from '../constants'; |
||||||
|
|
||||||
|
export const getLastModifiedDate = async (filePath: string) => |
||||||
|
fetch(`${LAST_COMMIT_BASE_URL}${filePath}/index.md&page=1&per_page=1`) |
||||||
|
.then(res => res.json()) |
||||||
|
.then(commits => commits[0].commit.committer.date) |
||||||
|
.catch(_ => |
||||||
|
fetch(`${LAST_COMMIT_BASE_URL}${filePath}.md&page=1&per_page=1`) |
||||||
|
.then(res => res.json()) |
||||||
|
.then(commits => commits[0].commit.committer.date) |
||||||
|
); |
Loading…
Reference in new issue