diff --git a/public/src/components/Collaborators/Collaborators.tsx b/public/src/components/Collaborators/Collaborators.tsx index 2c9a5733..17d2f2c7 100644 --- a/public/src/components/Collaborators/Collaborators.tsx +++ b/public/src/components/Collaborators/Collaborators.tsx @@ -1,7 +1,7 @@ import {ScReact} from "@veglem/screact"; import "./Collaborators.sass" import {AppNotesStore, NotesStoreState} from "../../modules/stores/NotesStore"; -import {imagesUlr} from "../../modules/api"; +import {imagesUlr} from "../../utils/consts"; export class Collaborators extends ScReact.Component { state = { diff --git a/public/src/components/NoteEditor/NoteEditor.tsx b/public/src/components/NoteEditor/NoteEditor.tsx index e5202f7e..56b4c24a 100644 --- a/public/src/components/NoteEditor/NoteEditor.tsx +++ b/public/src/components/NoteEditor/NoteEditor.tsx @@ -321,7 +321,7 @@ export class NoteEditor extends ScReact.Component} + content={} /> : "" } diff --git a/public/src/components/ProfileAvatar/ProfileAvatar.tsx b/public/src/components/ProfileAvatar/ProfileAvatar.tsx index 20f29ffd..af765587 100644 --- a/public/src/components/ProfileAvatar/ProfileAvatar.tsx +++ b/public/src/components/ProfileAvatar/ProfileAvatar.tsx @@ -1,13 +1,12 @@ import {ScReact} from '@veglem/screact'; import {Img} from '../Image/Image'; -import {imagesUlr} from '../../modules/api'; import {AppToasts} from '../../modules/toasts'; import {AppDispatcher} from '../../modules/dispatcher'; import {AppUserStore, UserActions, UserStoreState} from '../../modules/stores/UserStore'; import './ProfileAvatar.sass'; import {AvatarUploadLoader} from '../AvatarUplodaLoader/AvatarUploadLoader'; import {crop} from '../../modules/utils'; -import {MAX_AVATAR_SIZE} from '../../utils/consts'; +import {imagesUlr, MAX_AVATAR_SIZE} from '../../utils/consts'; type ProfileAvatarState = { uploadAnimation: boolean, diff --git a/public/src/components/SharePanel/SharePanel.tsx b/public/src/components/SharePanel/SharePanel.tsx index b66ed928..f5b53502 100644 --- a/public/src/components/SharePanel/SharePanel.tsx +++ b/public/src/components/SharePanel/SharePanel.tsx @@ -7,6 +7,7 @@ import {AppNotesStore, NotesActions} from "../../modules/stores/NotesStore"; import {parseNoteTitle} from "../../modules/utils"; import {AppDispatcher} from "../../modules/dispatcher"; import {AppToasts} from "../../modules/toasts"; +import {baseUrl} from "../../utils/consts"; export class SharePanel extends ScReact.Component { @@ -43,6 +44,8 @@ export class SharePanel extends ScReact.Component { } render() { + const noteUrl = baseUrl + "/notes/" + this.props.note?.id + return (
@@ -56,9 +59,9 @@ export class SharePanel extends ScReact.Component {

Поделиться ссылкой

Просматривать могут все, у кого есть ссылка - +
- +
diff --git a/public/src/modules/api.ts b/public/src/modules/api.ts index 120fe250..e6ced318 100644 --- a/public/src/modules/api.ts +++ b/public/src/modules/api.ts @@ -4,11 +4,7 @@ import { UserRegisterCredentialsType, UserUpdatePasswordCredentialsType } from './stores/UserStore'; -import {isDebug} from "../utils/consts"; - -const baseUrl = isDebug ? 'http://localhost:8080/api' : 'https://you-note.ru/api'; - -export const imagesUlr = isDebug ? 'http://localhost/images/' : 'https://you-note.ru/images/'; +import {baseUrl} from "../utils/consts"; enum RequestMethods { POST = 'POST', @@ -701,10 +697,10 @@ class NoteRequests { } class SharedNoteRequests { - private baseUrl = '/shared'; + private baseUrl = '/shared/note/'; Get = async (id: string) => { - const response = await fetch(baseUrl + this.baseUrl + '/' + id); + const response = await fetch(baseUrl + this.baseUrl + id); if (response.status === 200) { const data = await response.json() diff --git a/public/src/modules/router.tsx b/public/src/modules/router.tsx index abe7a9b5..a2ea7a59 100644 --- a/public/src/modules/router.tsx +++ b/public/src/modules/router.tsx @@ -137,8 +137,6 @@ export class Router extends ScReact.Component { })); page.loader(path).then((props) => { - console.log("123") - console.log(props) this.setState(s => ({ ...s, currPage: page.page, diff --git a/public/src/pages/Notes/loader.ts b/public/src/pages/Notes/loader.ts index 1bc61f1f..278d0f70 100644 --- a/public/src/pages/Notes/loader.ts +++ b/public/src/pages/Notes/loader.ts @@ -56,7 +56,6 @@ export const NotesLoader = async (path:string) => { const noteId = window.location.pathname.split('/').at(-1); AppSharedNoteRequests.Get(noteId).then(note => { - console.log(note) AppRouter.openSharedNotePage(note) }).catch(() => { AppRouter.go("/") diff --git a/public/src/utils/consts.ts b/public/src/utils/consts.ts index 9a81b12a..5c49ddf7 100644 --- a/public/src/utils/consts.ts +++ b/public/src/utils/consts.ts @@ -1,5 +1,11 @@ export const isDebug = process.env.NODE_ENV === 'development'; + +export const baseUrl = isDebug ? 'http://localhost:8080/api' : 'https://you-note.ru/api'; + +export const imagesUlr = isDebug ? 'http://localhost/images/' : 'https://you-note.ru/images/'; + + const MEGABYTE_SIZE = 1024 * 1024; export const MAX_AVATAR_SIZE = 5 * MEGABYTE_SIZE; export const MAX_ATTACH_SIZE = 30 * MEGABYTE_SIZE;