Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sistem Informasi Zakat
Sizakat 5.0 (Refactoring)
Sizakat Backend
Commits
6d9d0753
Commit
6d9d0753
authored
Aug 01, 2020
by
addffa
Browse files
[REFACTOR] revisi fungsi delete mutation
parent
3b25d162
Pipeline
#51247
passed with stage
in 9 minutes and 32 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sizakat/mustahik/mutations.py
View file @
6d9d0753
...
...
@@ -22,20 +22,13 @@ class MustahikMutation(DjangoModelFormMutation):
class
DeleteMustahik
(
graphene
.
Mutation
):
class
Arguments
:
id
=
graphene
.
ID
()
id
=
graphene
.
ID
(
required
=
True
)
deleted
=
graphene
.
Boolean
()
id_mustahik
=
graphene
.
ID
()
name
=
graphene
.
String
()
no_ktp
=
graphene
.
String
()
def
mutate
(
self
,
info
,
id
):
mustahik
=
Mustahik
.
objects
.
get
(
pk
=
id
)
name
=
mustahik
.
name
no_ktp
=
mustahik
.
no_ktp
mustahik
.
delete
()
deleted
=
True
return
DeleteMustahik
(
deleted
=
deleted
,
id_mustahik
=
id
,
name
=
name
,
no_ktp
=
no_ktp
)
Mustahik
.
objects
.
get
(
pk
=
id
).
delete
()
return
DeleteMustahik
(
deleted
=
True
)
class
DataSourceMutation
(
DjangoModelFormMutation
):
...
...
@@ -47,7 +40,7 @@ class DataSourceMutation(DjangoModelFormMutation):
class
DeleteDataSource
(
graphene
.
Mutation
):
class
Arguments
:
id
=
graphene
.
ID
()
id
=
graphene
.
ID
(
required
=
True
)
deleted
=
graphene
.
Boolean
()
...
...
sizakat/mustahik/tests.py
View file @
6d9d0753
...
...
@@ -278,12 +278,9 @@ class MustahikGraphQLTestCase(GraphQLTestCase):
mustahik_id
=
mustahik
.
pk
response
=
self
.
query
(
'''
mutation deleteMustahik($id: ID) {
mutation deleteMustahik($id: ID
!
) {
deleteMustahik(id: $id) {
deleted
idMustahik
name
noKtp
}
}
'''
,
...
...
@@ -826,7 +823,7 @@ class MustahikGraphQLTestCase(GraphQLTestCase):
datasource
=
DataSource
.
objects
.
all
()[
0
]
response
=
self
.
query
(
'''
mutation deleteDataSource($id: ID) {
mutation deleteDataSource($id: ID
!
) {
deleteDataSource(id: $id) {
deleted
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment