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**


Discussion:

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
+from app.api.modules import ModuleDetail, ModuleList
 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,7 +108,8 @@
 api.route(SettingDetail, 'setting_detail', '/settings/<id>', '/settings')
 
 # modules
-api.route(ModuleDetail, 'module_detail', '/modules/<id>', '/modules')
+api.route(ModuleDetail, 'module_detail', '/modules/<id>')
+api.route(ModuleList, 'module_list', '/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
+from flask_rest_jsonapi import ResourceDetail, ResourceList
 
 from app.api.bootstrap import api
 from app.api.schema.modules import ModuleSchema
@@ -6,6 +6,26 @@
 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: