Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gdd-sigma-poc
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
Container Registry
Model registry
Operate
Environments
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
Guillaume WANG
gdd-sigma-poc
Commits
06c57f5b
Commit
06c57f5b
authored
6 years ago
by
Olivér FACKLAM
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/change_GraphQL' into change_GraphQL
parents
d280480b
6e9d0351
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graphql/object_resolvers/messages.ts
+23
-2
23 additions, 2 deletions
src/graphql/object_resolvers/messages.ts
with
23 additions
and
2 deletions
src/graphql/object_resolvers/messages.ts
+
23
−
2
View file @
06c57f5b
...
...
@@ -8,6 +8,7 @@ import {User} from './users';
import
knex
from
'
../../../db/knex_router
'
;
import
{
Context
}
from
'
../typeDefs/queries
'
;
import
{
ApolloError
}
from
'
apollo-server-core
'
;
import
{
GroupSet
}
from
'
../models/tools
'
;
export
abstract
class
Message
{
...
...
@@ -153,6 +154,8 @@ export class Announcement extends Message {
*/
constructor
(
mid
:
number
)
{
super
(
mid
);
this
.
m_authors
=
new
GroupSet
();
this
.
m_recipients
=
new
GroupSet
();
}
/**
...
...
@@ -201,12 +204,28 @@ export class Announcement extends Message {
this
.
m_views
=
m
.
views
;
this
.
m_dataLoaded
=
true
;
return
true
;
}
else
{
return
false
;
}
//Charge les authors dans m_authors
data
=
await
knex
.
select
(
'
gid
'
).
from
(
'
announcements_authors
'
).
where
(
'
mid
'
,
this
.
mid
);
for
(
let
t
of
data
)
{
this
.
m_authors
.
add
(
t
.
gid
);
}
//Charge les recipients dans m_recipients
data
=
await
knex
.
select
(
'
gid
'
).
from
(
'
announcements_recipients
'
).
where
(
'
mid
'
,
this
.
mid
);
for
(
let
t
of
data
)
{
this
.
m_authors
.
add
(
t
.
gid
);
}
}
return
true
;
}
...
...
@@ -219,6 +238,8 @@ export class Announcement extends Message {
*/
protected
m_importance
:
number
protected
m_views
:
number
protected
m_authors
:
GroupSet
protected
m_recipients
:
GroupSet
/**
* Ci-dessous les resolvers a proprement parler.
...
...
@@ -234,7 +255,7 @@ export class Announcement extends Message {
*/
async
authors
(
args
,
context
:
Context
,
info
):
Promise
<
Group
[]
>
{
throw
"
Not implemented
"
;
/*return knex.select({ uid: 'group' }).from('group_message_relationships')
.where('message', messageID).whereIn('status', ['host', 'publish']);*/
}
...
...
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