Ghost
New
struxadotcloud
/
struxa
public
Star
0
Fork
0
Code
Issues
0
Pull requests
0
4ee2d74
1
branch
Go to file
t
Code
struxa
apps
web
src
lib
remote-backups.ts
fix(backups): scope remote backup callbacks to the requesting node
e29564e
2 months ago
12 lines · 401 B
1
import
{
eq
}
from
"
drizzle-orm
"
;
2
import
{
db
}
3
import
{
backups
}
4
5
export
async
function
getBackupWithServer
6
const
backup
=
7
where
:
eq
(
backups
8
with
:
{
server
:
true
9
}
)
;
10
if
(
!
backup
||
11
return
backup
;
12
}
from
"
@struxa/db
"
;
from
"
@struxa/db
"
;
(
uuid
:
string
,
nodeId
:
string
)
{
await
db
.
query
.
backups
.
findFirst
(
{
.
uuid
,
uuid
)
,
}
,
!
backup
.
server
||
backup
.
server
.
nodeId
!==
nodeId
)
return
null
;