-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate commit type classification in the frontend
Ref:#237 Time-spent: 1h32m
- Loading branch information
1 parent
9669452
commit d744e77
Showing
2 changed files
with
35 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict' | ||
|
||
export default async function (commitMessage: string) { | ||
|
||
const payload = commitMessage.trim() == '' ? '' : '?q=' + commitMessage.trim(); | ||
if (!payload) { | ||
return []; | ||
} | ||
|
||
const res = await fetch(window.location.protocol + '//' + window.location.hostname + ':48763/api/getCommitType?commitMessage=' + encodeURIComponent(payload)); | ||
|
||
if (!res.ok) { | ||
return []; | ||
} | ||
return await res.json(); | ||
} |
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