Created
December 24, 2021 19:27
-
-
Save albertBarsegyan/598fe5de0f9c2c7fc26e0ffd53b494b6 to your computer and use it in GitHub Desktop.
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
export const submitter = ( | |
endpoint, | |
{ fileName, committer, content, lang, contentType, branch = '' }, | |
) => { | |
const dataToSend = { | |
fileToUpdate: `${fileName}.${contentType}`, | |
committer, | |
content, | |
lang, | |
contentType, | |
branch, | |
}; | |
octokitResponse(endpoint, dataToSend).then((response) => { | |
// there is responce from github do whathever you want | |
}); | |
}; | |
// here we are calling submitter method | |
submitter('handleData', { | |
fileName: currentCourse.nameId, | |
committer: user.email, | |
lang: locale, | |
contentType: currentCourseType, | |
content: values.courseData, | |
branch: GithubOrganizationBranches.featureAutoCommitPush, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment