From 49069f518e5480f9d4c0d3d0ac29bc7857901e97 Mon Sep 17 00:00:00 2001 From: Darshan A S Date: Wed, 1 May 2024 09:22:51 +0000 Subject: [PATCH 1/2] Fix error while comitting a locked problem with an accepted solution. --- .husky/pre-commit | 2 +- dist/index.js | 2 +- src/action.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index bf41c98c..cb8cccbf 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1,2 @@ npm run package -git add . +git add dist/index.js diff --git a/dist/index.js b/dist/index.js index d7dca423..cefd836c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14654,7 +14654,7 @@ async function commit(params) { { path: path.normalize(questionPath), mode: "100644", - content: questionData, + content: `${questionData}`, }, { path: path.normalize(solutionPath), diff --git a/src/action.js b/src/action.js index 39b10b8b..4a264477 100644 --- a/src/action.js +++ b/src/action.js @@ -165,7 +165,7 @@ async function commit(params) { { path: path.normalize(questionPath), mode: "100644", - content: questionData, + content: `${questionData}`, }, { path: path.normalize(solutionPath), From 5e4d9820b0275dfa19f9e908df7524e3237e4f28 Mon Sep 17 00:00:00 2001 From: Darshan A S Date: Tue, 7 May 2024 19:04:59 +0000 Subject: [PATCH 2/2] Write a fallback message when unable to fetch a problem statement. --- dist/index.js | 2 +- src/action.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index cefd836c..0d78adcf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14654,7 +14654,7 @@ async function commit(params) { { path: path.normalize(questionPath), mode: "100644", - content: `${questionData}`, + content: questionData ?? "Unable to fetch the Problem statement.", }, { path: path.normalize(solutionPath), diff --git a/src/action.js b/src/action.js index 4a264477..9f7589bb 100644 --- a/src/action.js +++ b/src/action.js @@ -165,7 +165,7 @@ async function commit(params) { { path: path.normalize(questionPath), mode: "100644", - content: `${questionData}`, + content: questionData ?? "Unable to fetch the Problem statement.", }, { path: path.normalize(solutionPath),