Skip to content

Instantly share code, notes, and snippets.

@albertBarsegyan
Created December 24, 2021 19:27
Show Gist options
  • Save albertBarsegyan/598fe5de0f9c2c7fc26e0ffd53b494b6 to your computer and use it in GitHub Desktop.
Save albertBarsegyan/598fe5de0f9c2c7fc26e0ffd53b494b6 to your computer and use it in GitHub Desktop.
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