@quesmed/types 2.6.210 → 2.6.211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,19 +94,21 @@ const updateMarksheets = (cache, result, options) => {
94
94
  try {
95
95
  const { input } = variables;
96
96
  for (let i = 0; i < input.length; i++) {
97
- const marksheet = input[i];
97
+ const inputData = input[i];
98
+ const savedMarks = saveMarksheets.find((m) => m.id === inputData.marksheetId)?.marks;
99
+ const savedData = savedMarks?.find((m) => m.id === inputData.markId);
98
100
  cache.writeFragment({
99
101
  id: cache.identify({
100
- id: marksheet.markId,
102
+ id: inputData.markId,
101
103
  __typename: 'MarksheetMark',
102
104
  }),
103
105
  data: {
104
- timeTaken: marksheet.timeTaken || 0,
105
- mark: marksheet.mark,
106
- questionChoiceId: marksheet.choiceId,
106
+ timeTaken: savedData?.timeTaken || 0,
107
+ mark: savedData?.mark,
108
+ questionChoiceId: savedData?.questionChoiceId,
107
109
  isAnswered: true,
108
- result: 0,
109
- score: 0,
110
+ result: savedData?.result,
111
+ score: savedData?.score,
110
112
  },
111
113
  fragment: marksheet_1.NEW_MARK_FIELDS,
112
114
  });
@@ -91,19 +91,21 @@ export const updateMarksheets = (cache, result, options) => {
91
91
  try {
92
92
  const { input } = variables;
93
93
  for (let i = 0; i < input.length; i++) {
94
- const marksheet = input[i];
94
+ const inputData = input[i];
95
+ const savedMarks = saveMarksheets.find((m) => m.id === inputData.marksheetId)?.marks;
96
+ const savedData = savedMarks?.find((m) => m.id === inputData.markId);
95
97
  cache.writeFragment({
96
98
  id: cache.identify({
97
- id: marksheet.markId,
99
+ id: inputData.markId,
98
100
  __typename: 'MarksheetMark',
99
101
  }),
100
102
  data: {
101
- timeTaken: marksheet.timeTaken || 0,
102
- mark: marksheet.mark,
103
- questionChoiceId: marksheet.choiceId,
103
+ timeTaken: savedData?.timeTaken || 0,
104
+ mark: savedData?.mark,
105
+ questionChoiceId: savedData?.questionChoiceId,
104
106
  isAnswered: true,
105
- result: 0,
106
- score: 0,
107
+ result: savedData?.result,
108
+ score: savedData?.score,
107
109
  },
108
110
  fragment: NEW_MARK_FIELDS,
109
111
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.210",
3
+ "version": "2.6.211",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",