Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions codedigger/lists/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ class Meta:


class EditorListSerializer(serializers.Serializer):
# slug = serializers.CharField(required=True)
# friend = serializers.CharField(required=True)
slug = serializers.CharField(required=True)
friend = serializers.CharField(required=True)

class Meta:
model = Editor
Expand Down
10 changes: 10 additions & 0 deletions docs/routes/doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ <h2 class="section__title">Codeforces</h3>
</section>
<section id = "lists" class="js-section">
<h2 class="section__title">Lists</h3>
<a href="lists/AddUserToEditTheList.html">
<div class="block post-block">
<div class="method post-method">
POST
</div>
<span class="summary">
/lists/add
</span>
</div>
</a>
<a href="lists/UserlistAddProblemView.html">
<div class="block post-block">
<div class="method post-method">
Expand Down
197 changes: 197 additions & 0 deletions docs/routes/lists/AddUserToEditTheList.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="../static/images/codedigger-logo-48px.png" type="image/icon type">
<!-- UPDATE route title -->
<title>Codedigger REST API DOC - add</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/monokai-sublime.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800,900" rel="stylesheet">
<link rel="stylesheet" href="../static/css/global.css">
<link rel="stylesheet" href="../static/css/doc.css">
</head>

<body>
<div class="doc__bg"></div>
<nav class="header">
<h1 class="logo"> <a href="https://api.codedigger.tech/"> Codedigger {API} </a><span
class="logo__thin">Doc</span></h1>
<ul class="menu">
<div class="menu__item toggle"><span></span></div>
<li class="menu__item"><a href="https://github.com/Code-dig-ger" class="link"><i class="fa fa-github"></i>
Github</a></li>
<li class="menu__item"><a href="../doc.html" class="link"><i class="fa fa-home"></i> Home</a></li>
</ul>
</nav>
<div class="wrapper">
<aside class="doc__nav">
<ul>
<li class="js-btn selected"> <a href="#title"> Title </a></li>
<li class="js-btn"> <a href="#url"> URL </a></li>
<li class="js-btn"> <a href="#headers"> Headers </a></li>
<li class="js-btn"> <a href="#url-param"> URL Parameters </a></li>
<li class="js-btn"> <a href="#data-param"> Data Params </a></li>
<li class="js-btn"> <a href="#success-response"> Success Response </a></li>
<li class="js-btn"> <a href="#error-response"> Error Response </a></li>
<li class="js-btn"> <a href="#sample-call"> Sample Call </a></li>
<li class="js-btn"> <a href="#notes"> Notes </a></li>
</ul>

<p> <b>Author:</b> @jyothiprakashpanaik </p>
<p> <b>Created at:</b> Jan 24, 2022 </p>
<p> <b>Updated by:</b>
<ul>
<li> @jyothiprakashpanaik </li>
</ul>
</p>
<p> <b>Last Updated:</b> Jan 24, 2022 </p>

</aside>
<article class="doc__content">
<section id="title" class="js-section">
<h2 class="section__title">Title</h2>
<p> To add the user's friends to edit the list
</p>
</section>
<section id="url" class="js-section">
<h3 class="section__title">URL</h3>
<div class="block get-block">
<div class="method get-method">
GET
</div>
<span class="summary get-summary">
/lists/add
</span>
</div>
</section>
<section id="headers" class="js-section">
<h3 class="section__title">Headers</h3>
<p>
</p>
<table>
<tr>
<th>Header Name</th>
<th>Required</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>Authorization</td>
<td>true</td>
<td>string</td>
<td>
Bearer {Token}
</td>
</tr>
</table>
</section>
<section id="url-param" class="js-section">
<h3 class="section__title">URL Parameters</h3>
<p>
For GET Request.
If URL params exist, specify them in accordance with name mentioned in URL section.
Mention if is required or optional. Document data constraints.
</p>
<table>
<tr>
<th>Param Name</th>
<th>Required</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>friend</td>
<td>true</td>
<td>string</td>
<td>
friend=username of the friend that need's edit access.
</td>
</tr>
<tr>
<td>slug</td>
<td>true</td>
<td>string</td>
<td>
slug=list name that the user wants to give edit access.
</td>
</tr>
</table>
</section>
<section id="success-response" class="js-section">
<h3 class="section__title">Success Response</h3>
<p>
Return the staus of the request along with message.
</p>
<p>
Status Code: 200
</p>
<p>
Sample Response:
</p>
<pre>
<code class="language-json">
{
"status": "OK",
"result": "User has been added to the list"
}
</code>
</pre>
</section>
<section id="error-response" class="js-section">
<h3 class="section__title">Error Response</h3>
<p>
Reason of Error: If the user is not Authentication.
</p>
<p>
Status Code: 400 BAD REQUEST
</p>
<p>
Error Response:
</p>
<pre>
<code class="language-json">
{
"status": "FAILED",
"error": "Authentication credentials were not provided"
}
</code>
</pre>
</section>
<section id="sample-call" class="js-section">
<h3 class="section__title">Sample Call</h3>
<p>
Just a sample call to your endpoint in a runnable format
($.ajax call or a curl request) - this makes life easier and more predictable.
</p>
<pre>
<code class="language-bash">
curl -X POST "https://api.codedigger.tech/lists/add"
</code>
</pre>
</section>
<section id="notes" class="js-section">
<h3 class="section__title">Notes</h3>
<p>
This is where all uncertainties, commentary, discussion etc.., can go.
Mention timestamp and identify yourself when leaving comments here.
</p>
</section>
</article>
</div>

<footer class="footer"> &copy; Copyright <a href= "https://codedigger.tech" target="_blank"
class="link link--light">Codedigger</a> 2021.</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
hljs.highlightAll();
</script>
<script src="../static/js/docs.js"></script>
</body>

</html>
Loading