Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-029
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2023-029
2023-029
Commits
0dbfe927
Commit
0dbfe927
authored
Oct 29, 2023
by
Janith Gamage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update
parent
a87c7a22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
+34
-3
Project/Frontend/SignConnectPlus/src/store/reducers/marksCalculator.ts
...end/SignConnectPlus/src/store/reducers/marksCalculator.ts
+34
-3
No files found.
Project/Frontend/SignConnectPlus/src/store/reducers/marksCalculator.ts
View file @
0dbfe927
...
...
@@ -41,11 +41,17 @@ const slice = createSlice({
state
.
isLoading
=
false
;
},
// POST
USER
// POST
marksCalculatorSuccess
marksCalculatorSuccess
(
state
,
action
)
{
state
.
marksCalculator
=
action
.
payload
.
result
;
state
.
success
=
"
Marks Calculated Successfully.
"
},
// POST default marksCalculatorSuccess
defaultMarksCalculatorSuccess
(
state
,
action
)
{
state
.
marksCalculator
=
action
.
payload
.
result
;
state
.
success
=
"
Marks Calculated Successfully.
"
},
}
});
...
...
@@ -76,8 +82,7 @@ export function CalculateMarks(curriculumIndex: number, tutorialIndex: number, i
return
async
()
=>
{
dispatch
(
slice
.
actions
.
startLoading
());
try
{
// Construct the request body as needed (e.g., for formData)
try
{
const
formData
=
new
FormData
();
formData
.
append
(
'
image
'
,
imageData
);
formData
.
append
(
'
class
'
,
targetClass
);
...
...
@@ -91,3 +96,29 @@ export function CalculateMarks(curriculumIndex: number, tutorialIndex: number, i
}
};
};
/**
* POST Default Marks Calculator
* @param original_image
* @param user_input_image
* @returns
*/
export
function
DefaultCalculateMarks
(
original_image
:
any
,
user_input_image
:
any
)
{
return
async
()
=>
{
dispatch
(
slice
.
actions
.
startLoading
());
try
{
const
formData
=
new
FormData
();
formData
.
append
(
'
original_image
'
,
original_image
);
formData
.
append
(
'
user_input_image
'
,
user_input_image
);
const
response
=
await
axiosServices
.
post
(
`/rest_node/marks-calculator/default`
,
formData
);
dispatch
(
slice
.
actions
.
marksCalculatorSuccess
(
response
.
data
));
}
catch
(
error
)
{
dispatch
(
slice
.
actions
.
hasError
(
error
));
}
finally
{
dispatch
(
slice
.
actions
.
finishLoading
());
}
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment