Skip to content

Commit 99d0694

Browse files
committed
fixes & Bump version
1 parent 9cb4214 commit 99d0694

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/note_mark/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.0"
1+
__version__ = "0.1.1"

src/note_mark/static/script.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function do_note_autosave(api_url) {
103103
const form_data = new FormData(document.getElementById("form-edit-note"));
104104
fetch(api_url, {
105105
body: form_data,
106-
method: "patch"
106+
method: "post"
107107
})
108108
.then(response => {
109109
if (response.ok) {
@@ -134,7 +134,7 @@ function do_note_save(api_url) {
134134
const form_data = new FormData(document.getElementById("form-edit-note"));
135135
fetch(api_url, {
136136
body: form_data,
137-
method: "patch"
137+
method: "post"
138138
})
139139
.then(response => {
140140
if (response.ok) {

src/note_mark/templates/share-link/note/edit.jinja2

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<a class="button" href="{{ url_for('share_link.get_notebook', share_link_uuid=share_link_uuid) }}">Back To Notebook</a>
1010
<a class="button" href="{{ url_for('share_link.view_note', share_link_uuid=share_link_uuid, note_uuid=note.uuid) }}">View</a>
1111
</div>
12-
<form class="container" id="form-edit-note" action="" method="post">
12+
<form class="container" id="form-edit-note" action="" method="post" onsubmit="return false;">
1313
<div class="control-bar" id="edit-toolbox">
14-
<button type="submit">Save</button>
14+
<button type="submit" onclick="do_note_save(`{{ url_for('api.note_save', notebook_uuid=note.notebook_id, note_uuid=note.uuid) }}`)">Save</button>
1515
{% include "/shared/includes/edit-toolbox.jinja2" %}
1616
</div>
1717
<textarea name="content" id="edit-note-content" placeholder="enter content..." autofocus="true">{{ content }}</textarea>

src/note_mark/views/api.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import asyncio
22
from uuid import UUID
33

4-
from quart import Blueprint, json, jsonify, make_response, render_template, request
5-
from quart_auth import current_user
4+
from quart import Blueprint, jsonify, make_response, render_template, request
5+
from quart_auth import current_user, login_required
66
from tortoise.exceptions import DoesNotExist
77

88
from ..database import crud
@@ -181,7 +181,7 @@ async def note_prefix(notebook_uuid, note_uuid):
181181
return "invalid notebook/user/note", 404
182182

183183

184-
@blueprint.route("/notebook/<notebook_uuid>/notes/<note_uuid>/auto-save", methods=["PATCH"])
184+
@blueprint.route("/notebook/<notebook_uuid>/notes/<note_uuid>/auto-save", methods=["POST"])
185185
@api_login_required
186186
async def note_auto_save(notebook_uuid, note_uuid):
187187
try:
@@ -217,8 +217,8 @@ async def note_auto_save(notebook_uuid, note_uuid):
217217
return "missing required params", 400
218218

219219

220-
@blueprint.route("/notebook/<notebook_uuid>/notes/<note_uuid>/save", methods=["PATCH"])
221-
@api_login_required
220+
@blueprint.route("/notebook/<notebook_uuid>/notes/<note_uuid>/save", methods=["POST"])
221+
@login_required
222222
async def note_save(notebook_uuid, note_uuid):
223223
try:
224224
notebook_uuid = UUID(notebook_uuid)

0 commit comments

Comments
 (0)