File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 88 < form name ="form " action ="# ">
99 < p > < label for ="author "> Автор: </ label > < input type ="text " id ="author " name ="author " required > </ p >
1010 < p > < label for ="text "> Текст: </ label > < textarea rows ="30 " cols ="100 " id ="text " name ="text "> </ textarea > </ p >
11- < input type ="submit " onclick ="onSend() ">
11+ < input type ="button " value =" Submit " onclick ="onSend() ">
1212 </ form >
1313 < span id ="latest "> unchanged</ span >
1414 < script src ="../r/index.js "> </ script >
Original file line number Diff line number Diff line change 1- fetch ( ".. /api/v1/latest" )
1+ fetch ( "/api/v1/latest" )
22 . then ( function ( response ) {
33 return response . json ( ) ;
44 } )
@@ -18,15 +18,15 @@ function onSend() {
1818 const author = document . forms [ "form" ] . author . value ;
1919 const text = document . forms [ "form" ] . text . value ;
2020
21- fetch ( ".. /api/v1/posts?author=" + author , {
21+ fetch ( "/api/v1/posts?author=" + author , {
2222 method : "POST" ,
2323 body : text ,
2424 } )
2525 . then ( function ( response ) {
2626 return response . json ( ) ;
2727 } )
2828 . then ( function ( json ) {
29- document . location = '.. /' + json [ 'uuid' ] ;
29+ document . location . href = '/' + json [ 'uuid' ] ;
3030 } )
3131 . catch ( function ( error ) {
3232 alert ( error ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ function get_text_id() {
66}
77
88function fetch_text_by_id ( id ) {
9- return fetch ( ".. /api/v1/posts/" + id ) ;
9+ return fetch ( "/api/v1/posts/" + id ) ;
1010}
1111
1212function setup_text ( ) {
You can’t perform that action at this time.
0 commit comments