Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Backend-MECRED
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
Harbor 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
MECRED
Backend-MECRED
Merge requests
!54
Issue
#23
/CREATE-contact-email
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#23
/CREATE-contact-email
issue/53-CREATE-contact-email
into
develop
Overview
0
Commits
1
Pipelines
0
Changes
4
Merged
jsk22
requested to merge
issue/53-CREATE-contact-email
into
develop
2 months ago
Overview
0
Commits
1
Pipelines
0
Changes
4
Expand
nter the commit message for your changes. Lines starting
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
fe56b91b
1 commit,
2 months ago
4 files
+
102
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
src/routes/contact.route.ts
0 → 100644
+
26
−
0
Options
import
{
ContactService
}
from
"
@/services/contact.service
"
;
import
{
zValidator
}
from
"
@hono/zod-validator
"
;
import
{
Hono
}
from
"
hono
"
;
import
Container
from
"
typedi
"
;
import
{
z
}
from
"
zod
"
;
const
contactService
=
Container
.
get
(
ContactService
)
export
const
contactRoute
=
new
Hono
()
.
post
(
'
/contact
'
,
zValidator
(
'
json
'
,
z
.
object
({
name
:
z
.
string
().
min
(
1
,
'
Name is required
'
),
email
:
z
.
string
().
email
(),
message
:
z
.
string
().
min
(
10
,
'
Message should be at least 10 characters long
'
),
}))
,
async
(
c
)
=>
{
try
{
const
{
name
,
email
,
message
}
=
await
c
.
req
.
json
();
await
contactService
.
sendContactEmail
(
email
,
message
,
name
)
return
c
.
json
({
status
:
'
success
'
,
name
,
email
,
message
});
}
catch
(
error
)
{
console
.
error
(
'
Error sending contact email:
'
,
error
);
return
c
.
json
({
error
:
'
Invalid request data
'
},
400
);
}
});
\ No newline at end of file
Loading