Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tsi1-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rodrigo Sastre Marotta
tsi1-backend
Commits
1d8baf26
Commit
1d8baf26
authored
4 years ago
by
esantangelo
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
584eac2d
No related branches found
Branches containing commit
No related tags found
2 merge requests
!26
Develop
,
!23
Feature/survey
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tsi1.Api/Tsi1.BusinessLayer/Helpers/ErrorMessages.cs
+1
-0
1 addition, 0 deletions
Tsi1.Api/Tsi1.BusinessLayer/Helpers/ErrorMessages.cs
Tsi1.Api/Tsi1.BusinessLayer/Services/SurveyService.cs
+7
-7
7 additions, 7 deletions
Tsi1.Api/Tsi1.BusinessLayer/Services/SurveyService.cs
with
8 additions
and
7 deletions
Tsi1.Api/Tsi1.BusinessLayer/Helpers/ErrorMessages.cs
+
1
−
0
View file @
1d8baf26
...
...
@@ -59,5 +59,6 @@ namespace Tsi1.BusinessLayer.Helpers
public
const
string
SurveyIsNull
=
"La encuesta es nula"
;
public
const
string
SurveyHasNoQuestions
=
"La encuesta no tiene preguntas"
;
public
const
string
InvalidSurvey
=
"La encuesta no pertenece a la facultad con id '{0}'"
;
public
const
string
SurveyResponseAlreadyExist
=
"El usuario '{0}' ya completo la encuesta '{1}'"
;
}
}
This diff is collapsed.
Click to expand it.
Tsi1.Api/Tsi1.BusinessLayer/Services/SurveyService.cs
+
7
−
7
View file @
1d8baf26
...
...
@@ -154,14 +154,15 @@ namespace Tsi1.BusinessLayer.Services
if
(
existingSurveyResponse
!=
null
)
{
_mapper
.
Map
(
surveyResponse
,
existingSurveyResponse
);
}
else
{
var
newSurveyResponse
=
_mapper
.
Map
<
SurveyResponse
>(
surveyResponse
);
_context
.
Add
(
newSurveyResponse
);
result
.
HasError
=
true
;
result
.
AddMessage
(
string
.
Format
(
ErrorMessages
.
SurveyResponseAlreadyExist
,
surveyResponse
.
UserId
,
surveyResponse
.
SurveyId
));
return
result
;
}
var
newSurveyResponse
=
_mapper
.
Map
<
SurveyResponse
>(
surveyResponse
);
_context
.
Add
(
newSurveyResponse
);
await
_context
.
SaveChangesAsync
();
return
result
;
...
...
@@ -172,7 +173,6 @@ namespace Tsi1.BusinessLayer.Services
var
result
=
new
ServiceResult
<
List
<
SurveyResponseDetailDto
>>();
var
tenant
=
await
_context
.
Tenants
.
FirstOrDefaultAsync
(
x
=>
x
.
Id
==
tenantId
);
var
tenantAdmin
=
await
_context
.
Tenants
.
FirstOrDefaultAsync
(
x
=>
x
.
Name
==
TenantAdmin
.
Name
);
if
(
tenant
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment