+class NoteApiSaveView(View):
+ http_method_names = ['post']
+
+ @csrf_exempt
+ def dispatch(self, *args, **kwargs):
+ return super().dispatch(*args, **kwargs)
+
+ def post(self, request, *args, **kwargs):
+ note = Note.objects.get(slug=kwargs['slug'])
+ note.text = request.POST['text']
+ note.save()
+ return HttpResponse('ok')
+
+