We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Sort message-settings by id
**Describe the bug**
<!-- A clear and concise description of what the bug is. -->
Sort message-settings by id

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

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `app/api/message_settings.py`
Content:
```
1 from flask_rest_jsonapi import ResourceDetail, ResourceList
2 
3 from app.api.bootstrap import api
4 from app.api.schema.message_settings import MessageSettingSchema
5 from app.models import db
6 from app.models.message_setting import MessageSettings
7 
8 
9 class MessageSettingsList(ResourceList):
10     """
11     List Events Role Permission
12     """
13     decorators = (api.has_permission('is_admin', methods="GET"),)
14     methods = ['GET']
15     schema = MessageSettingSchema
16     data_layer = {'session': db.session,
17                   'model': MessageSettings}
18 
19 
20 class MessageSettingsDetail(ResourceDetail):
21     """
22     Events Role Permission detail by id
23     """
24     schema = MessageSettingSchema
25     decorators = (api.has_permission('is_admin', methods="PATCH"),)
26     methods = ['GET', 'PATCH']
27     data_layer = {'session': db.session,
28                   'model': MessageSettings}
29
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/app/api/message_settings.py b/app/api/message_settings.py
--- a/app/api/message_settings.py
+++ b/app/api/message_settings.py
@@ -10,11 +10,23 @@
     """
     List Events Role Permission
     """
+    def query(self, view_kwargs):
+        """
+        query method for Message Setting List
+        :param view_kwargs:
+        :return:
+        """
+        query_ = db.session.query(MessageSettings).order_by(MessageSettings.id)
+        return query_
+
     decorators = (api.has_permission('is_admin', methods="GET"),)
     methods = ['GET']
     schema = MessageSettingSchema
     data_layer = {'session': db.session,
-                  'model': MessageSettings}
+                  'model': MessageSettings,
+                  'methods': {
+                      'query': query
+                  }}
 
 
 class MessageSettingsDetail(ResourceDetail):

{"golden_diff": "diff --git a/app/api/message_settings.py b/app/api/message_settings.py\n--- a/app/api/message_settings.py\n+++ b/app/api/message_settings.py\n@@ -10,11 +10,23 @@\n     \"\"\"\n     List Events Role Permission\n     \"\"\"\n+    def query(self, view_kwargs):\n+        \"\"\"\n+        query method for Message Setting List\n+        :param view_kwargs:\n+        :return:\n+        \"\"\"\n+        query_ = db.session.query(MessageSettings).order_by(MessageSettings.id)\n+        return query_\n+\n     decorators = (api.has_permission('is_admin', methods=\"GET\"),)\n     methods = ['GET']\n     schema = MessageSettingSchema\n     data_layer = {'session': db.session,\n-                  'model': MessageSettings}\n+                  'model': MessageSettings,\n+                  'methods': {\n+                      'query': query\n+                  }}\n \n \n class MessageSettingsDetail(ResourceDetail):\n", "issue": "Sort message-settings by id\n**Describe the bug**\r\n<!-- A clear and concise description of what the bug is. -->\r\nSort message-settings by id\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Go to '...'\r\n2. Click on '....'\r\n3. Scroll down to '....'\r\n4. See error\r\n\r\n**Expected behavior**\r\n<!-- A clear and concise description of what you expected to happen. -->\r\n\r\n**Stacktrace**\r\n<!-- If applicable, add stacktrace to help explain your problem. -->\r\n\r\n**Additional details (please complete the following information):**\r\n - OS: [e.g. MacOS, Ubuntu, CentOS]\r\n - Python Version [e.g. `3.5`, `3.6`]\r\n - `HEAD` Commit hash [e.g. `4629c62`]\r\n\r\n**Additional context**\r\n<!-- Add any other context about the problem here. -->\r\n**Wanna work on this issue**\n", "before_files": [{"content": "from flask_rest_jsonapi import ResourceDetail, ResourceList\n\nfrom app.api.bootstrap import api\nfrom app.api.schema.message_settings import MessageSettingSchema\nfrom app.models import db\nfrom app.models.message_setting import MessageSettings\n\n\nclass MessageSettingsList(ResourceList):\n    \"\"\"\n    List Events Role Permission\n    \"\"\"\n    decorators = (api.has_permission('is_admin', methods=\"GET\"),)\n    methods = ['GET']\n    schema = MessageSettingSchema\n    data_layer = {'session': db.session,\n                  'model': MessageSettings}\n\n\nclass MessageSettingsDetail(ResourceDetail):\n    \"\"\"\n    Events Role Permission detail by id\n    \"\"\"\n    schema = MessageSettingSchema\n    decorators = (api.has_permission('is_admin', methods=\"PATCH\"),)\n    methods = ['GET', 'PATCH']\n    data_layer = {'session': db.session,\n                  'model': MessageSettings}\n", "path": "app/api/message_settings.py"}], "after_files": [{"content": "from flask_rest_jsonapi import ResourceDetail, ResourceList\n\nfrom app.api.bootstrap import api\nfrom app.api.schema.message_settings import MessageSettingSchema\nfrom app.models import db\nfrom app.models.message_setting import MessageSettings\n\n\nclass MessageSettingsList(ResourceList):\n    \"\"\"\n    List Events Role Permission\n    \"\"\"\n    def query(self, view_kwargs):\n        \"\"\"\n        query method for Message Setting List\n        :param view_kwargs:\n        :return:\n        \"\"\"\n        query_ = db.session.query(MessageSettings).order_by(MessageSettings.id)\n        return query_\n\n    decorators = (api.has_permission('is_admin', methods=\"GET\"),)\n    methods = ['GET']\n    schema = MessageSettingSchema\n    data_layer = {'session': db.session,\n                  'model': MessageSettings,\n                  'methods': {\n                      'query': query\n                  }}\n\n\nclass MessageSettingsDetail(ResourceDetail):\n    \"\"\"\n    Events Role Permission detail by id\n    \"\"\"\n    schema = MessageSettingSchema\n    decorators = (api.has_permission('is_admin', methods=\"PATCH\"),)\n    methods = ['GET', 'PATCH']\n    data_layer = {'session': db.session,\n                  'model': MessageSettings}\n", "path": "app/api/message_settings.py"}]}