Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
8f526562
You need to sign in or sign up before continuing.
Commit
8f526562
authored
Jan 25, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: objection.js 2.0 compat fixes
parent
3e991fa5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
12 deletions
+8
-12
page.js
server/graph/resolvers/page.js
+3
-5
pages.js
server/models/pages.js
+3
-5
userKeys.js
server/models/userKeys.js
+1
-1
users.js
server/models/users.js
+1
-1
No files found.
server/graph/resolvers/page.js
View file @
8f526562
...
...
@@ -61,11 +61,9 @@ module.exports = {
'createdAt'
,
'updatedAt'
])
.
eagerAlgorithm
(
WIKI
.
models
.
Objection
.
Model
.
JoinEagerAlgorithm
)
.
eager
(
'tags(selectTags)'
,
{
selectTags
:
builder
=>
{
builder
.
select
(
'tag'
)
}
.
withGraphJoined
(
'tags'
)
.
modifyGraph
(
'tags'
,
builder
=>
{
builder
.
select
(
'tag'
)
})
.
modify
(
queryBuilder
=>
{
if
(
args
.
limit
)
{
...
...
server/models/pages.js
View file @
8f526562
...
...
@@ -704,11 +704,9 @@ module.exports = class Page extends Model {
])
.
joinRelated
(
'author'
)
.
joinRelated
(
'creator'
)
.
eagerAlgorithm
(
Model
.
JoinEagerAlgorithm
)
.
eager
(
'tags(selectTags)'
,
{
selectTags
:
builder
=>
{
builder
.
select
(
'tag'
,
'title'
)
}
.
withGraphJoined
(
'tags'
)
.
modifyGraph
(
'tags'
,
builder
=>
{
builder
.
select
(
'tag'
,
'title'
)
})
.
where
(
queryModeID
?
{
'pages.id'
:
opts
...
...
server/models/userKeys.js
View file @
8f526562
...
...
@@ -56,7 +56,7 @@ module.exports = class UserKey extends Model {
}
static
async
validateToken
({
kind
,
token
},
context
)
{
const
res
=
await
WIKI
.
models
.
userKeys
.
query
().
findOne
({
kind
,
token
}).
eager
(
'user'
)
const
res
=
await
WIKI
.
models
.
userKeys
.
query
().
findOne
({
kind
,
token
}).
withGraphJoined
(
'user'
)
if
(
res
)
{
await
WIKI
.
models
.
userKeys
.
query
().
deleteById
(
res
.
id
)
if
(
moment
.
utc
().
isAfter
(
moment
.
utc
(
res
.
validUntil
)))
{
...
...
server/models/users.js
View file @
8f526562
...
...
@@ -705,7 +705,7 @@ module.exports = class User extends Model {
}
static
async
getGuestUser
()
{
const
user
=
await
WIKI
.
models
.
users
.
query
().
findById
(
2
).
eager
(
'groups'
).
modifyEager
(
'groups'
,
builder
=>
{
const
user
=
await
WIKI
.
models
.
users
.
query
().
findById
(
2
).
withGraphJoined
(
'groups'
).
modifyGraph
(
'groups'
,
builder
=>
{
builder
.
select
(
'groups.id'
,
'permissions'
)
})
if
(
!
user
)
{
...
...
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