Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
treinamento-2025.1-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
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
RICARDO PRADO FARIA
treinamento-2025.1-backend
Commits
88a9123f
Commit
88a9123f
authored
2 months ago
by
Ricardo
Browse files
Options
Downloads
Patches
Plain Diff
FIX import name adjust
parent
6b8bc767
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/handlers/implants.ts
+6
-6
6 additions, 6 deletions
src/handlers/implants.ts
with
6 additions
and
6 deletions
src/handlers/implants.ts
+
6
−
6
View file @
88a9123f
import
{
type
Request
,
type
Response
}
from
'
express
'
;
import
{
implants
}
from
'
@/db/schema
'
;
import
{
implants
Table
}
from
'
@/db/schema
'
;
import
{
db
}
from
"
@/db
"
;
import
{
eq
}
from
'
drizzle-orm
'
;
import
{
implantSchema
}
from
'
@/validators/implantsValidator
'
;
...
...
@@ -15,7 +15,7 @@ export default class implant{
}
static
async
getImplant
(
id
:
number
){
const
searched
=
await
db
.
select
().
from
(
implants
).
where
(
eq
(
implants
.
id
,
id
)).
limit
(
1
);
const
searched
=
await
db
.
select
().
from
(
implants
Table
).
where
(
eq
(
implants
Table
.
id
,
id
)).
limit
(
1
);
return
searched
[
0
]
||
null
;
}
...
...
@@ -47,7 +47,7 @@ export default class implant{
return
res
.
status
(
404
).
json
({
error
:
"
Not Found
"
});
}
const
updates
:
Partial
<
typeof
implants
.
$inferInsert
>
=
{
const
updates
:
Partial
<
typeof
implants
Table
.
$inferInsert
>
=
{
name
:
req
.
body
.
name
||
updated_implant
.
name
,
price
:
req
.
body
.
price
||
updated_implant
.
price
,
cyberCost
:
req
.
body
.
cyberCost
||
updated_implant
.
cyberCost
,
...
...
@@ -55,7 +55,7 @@ export default class implant{
};
try
{
await
db
.
update
(
implants
).
set
(
updates
).
where
(
eq
(
implants
.
id
,
id
));
await
db
.
update
(
implants
Table
).
set
(
updates
).
where
(
eq
(
implants
Table
.
id
,
id
));
}
catch
(
error
)
{
return
res
.
status
(
500
).
json
({
error
:
"
Update User Error
"
})
}
...
...
@@ -75,7 +75,7 @@ export default class implant{
}
try
{
await
db
.
delete
(
implants
).
where
(
eq
(
implants
.
id
,
id
));
await
db
.
delete
(
implants
Table
).
where
(
eq
(
implants
Table
.
id
,
id
));
return
res
.
status
(
200
).
json
({
message
:
"
Implant removed successfully
"
});
}
catch
(
error
)
{
return
res
.
status
(
500
).
json
({
error
:
"
Implant Removal Error
"
});
...
...
@@ -92,7 +92,7 @@ export default class implant{
const
{
name
,
price
,
cyberCost
,
bodyPart
}
=
implant_package
.
data
;
try
{
const
brand_new
=
await
db
.
insert
(
implants
).
values
({
const
brand_new
=
await
db
.
insert
(
implants
Table
).
values
({
name
,
price
,
cyberCost
,
...
...
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