Repository: fossasia/open-event-server

Issue:
Modules API gives 404 at localhost
**I'm submitting a ...**  (check one with "x")
- [x] bug report
- [ ] feature request
- [ ] support request => Please do not submit support requests here, instead ask your query in out Gitter channel at https://gitter.im/fossasia/open-event-server

**Current behavior:**
<!-- Describe how the bug manifests. -->

Currently, neither GET  nor PATCH is working in `/v1/modules`
**Expected behavior:**
<!-- Describe what the behavior would be without the bug. -->

It should work.
**Steps to reproduce:**
<!-- If you are able to illustrate the bug or feature request with an example, please provide steps to reproduce -->

**Related code:**

```
insert any relevant code here else remove this section
```

**Other information:**
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->

**System information:** 

<!-- Add information about the system your facing this bug on. If you think this is irrelevant or if it's a UI bug or a feature request, please remove this section -->

```
Your operating system
```

```
output of `python --version`
```
**Wanna work on this issue**
Travis Build failed
**Describe the bug**
A clear and concise description of what the bug is.
Currently, travis build is failing.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Stacktrace**
If applicable, add stacktrace to help explain your problem.

**Additional details (please complete the following information):**
 - OS: [e.g. MacOS, Ubuntu, CentOS]
 - Python Version [e.g. `3.5`, `3.6`]
 - `HEAD` Commit hash [e.g. `4629c62`]

**Additional context**
Add any other context about the problem here.

**Wanna work on it**


Discussion:

Travis servers are having issues, that's all
Well, apparently our build is actually failing now!

it appears to be here 
```
127.0.0.1 - - [22/May/2018 20:21:04] "PATCH /v1/auth/reset-password HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [22/May/2018 20:21:04] "PATCH /v1/auth/reset-password HTTP/1.1" 200 -
pass: PATCH /v1/auth/reset-password duration: 148ms
info: Displaying failed tests...
fail: GET /v1/modules?page%5bsize%5d=10&page%5bnumber%5d=2&sort=app-name&filter=%5B%5D duration: 69ms
fail: body: At '/data' Missing required property: data
body: At '/links' Missing required property: links
statusCode: Status code is not '200'
```

Will  fix it today.

Resolving patch:
diff --git a/app/api/__init__.py b/app/api/__init__.py
--- a/app/api/__init__.py
+++ b/app/api/__init__.py
@@ -46,7 +46,7 @@
 from app.api.custom_forms import CustomFormList, CustomFormListPost, CustomFormDetail, CustomFormRelationshipRequired
 from app.api.faqs import FaqListPost, FaqList, FaqDetail, FaqRelationshipRequired, FaqRelationshipOptional
 from app.api.feedbacks import FeedbackListPost, FeedbackList, FeedbackDetail, FeedbackRelationshipRequired
-from app.api.modules import ModuleDetail, ModuleList
+from app.api.modules import ModuleDetail
 from app.api.custom_placeholders import CustomPlaceholderList, CustomPlaceholderDetail, CustomPlaceholderRelationship
 from app.api.activities import ActivityList, ActivityDetail
 from app.api.orders import OrdersList, OrderDetail, OrderRelationship, ChargeList, OrdersListPost
@@ -108,8 +108,7 @@
 api.route(SettingDetail, 'setting_detail', '/settings/<id>', '/settings')
 
 # modules
-api.route(ModuleDetail, 'module_detail', '/modules/<id>')
-api.route(ModuleList, 'module_list', '/modules')
+api.route(ModuleDetail, 'module_detail', '/modules/<id>', '/modules')
 
 # pages
 api.route(PageList, 'page_list', '/pages')
diff --git a/app/api/modules.py b/app/api/modules.py
--- a/app/api/modules.py
+++ b/app/api/modules.py
@@ -1,4 +1,4 @@
-from flask_rest_jsonapi import ResourceDetail, ResourceList
+from flask_rest_jsonapi import ResourceDetail
 
 from app.api.bootstrap import api
 from app.api.schema.modules import ModuleSchema
@@ -6,26 +6,6 @@
 from app.models.module import Module
 
 
-class ModuleList(ResourceList):
-    """
-    module list
-    """
-    def before_get(self, *args, **kwargs):
-        """
-        before get method to get the resource id for fetching details
-        :param args:
-        :param kwargs:
-        :return:
-        """
-        kwargs['id'] = 1
-
-    decorators = (api.has_permission('is_super_admin', methods=['POST', 'GET'], id="1"),)
-    methods = ['GET', 'POST']
-    schema = ModuleSchema
-    data_layer = {'session': db.session,
-                  'model': Module}
-
-
 class ModuleDetail(ResourceDetail):
     """
     module detail by id


Test patch: