MCPcopy
hub / github.com/jarun/buku / post

Method post

bukuserver/api.py:199–213  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

197 for bookmark in all_bookmarks]})
198
199 def post(self):
200 try:
201 form = ApiBookmarkCreateForm(data=request.get_json())
202 except BadRequest:
203 return Response.INVALID_REQUEST()
204 if not form.validate():
205 return Response.invalid(form.errors)
206 with get_bukudb() as bukudb:
207 index = bukudb.add_rec(
208 form.url.data,
209 form.title.data,
210 form.tags_str,
211 form.description.data,
212 fetch=form.fetch.data)
213 return Response.from_flag(index is not None, data=index and {'index': index})
214
215 def delete(self):
216 with get_bukudb() as bukudb:

Callers 13

test_create_and_fetchFunction · 0.80
test_create_redirectFunction · 0.80
test_create_duplicateFunction · 0.80
test_updateFunction · 0.80
test_update_redirectFunction · 0.80
test_deleteFunction · 0.80
test_api_tagFunction · 0.80
test_api_bookmarkFunction · 0.80
test_api_bookmark_deleteFunction · 0.80
test_api_fetch_dataFunction · 0.80
test_api_bookmark_rangeFunction · 0.80

Calls 6

get_bukudbFunction · 0.85
validateMethod · 0.80
invalidMethod · 0.80
add_recMethod · 0.80
from_flagMethod · 0.80

Tested by 13

test_create_and_fetchFunction · 0.64
test_create_redirectFunction · 0.64
test_create_duplicateFunction · 0.64
test_updateFunction · 0.64
test_update_redirectFunction · 0.64
test_deleteFunction · 0.64
test_api_tagFunction · 0.64
test_api_bookmarkFunction · 0.64
test_api_bookmark_deleteFunction · 0.64
test_api_fetch_dataFunction · 0.64
test_api_bookmark_rangeFunction · 0.64