renamed typo

This commit is contained in:
SrGooglo 2023-07-08 13:43:52 +00:00
parent 66cfbbd714
commit 796d6d7668
14 changed files with 20 additions and 19 deletions

View File

@ -157,7 +157,7 @@ class ComtyApp extends React.Component {
static publicMethods = { static publicMethods = {
controls: { controls: {
toogleUIVisibility: (to) => { toggleUIVisibility: (to) => {
if (app.layout.sidebar) { if (app.layout.sidebar) {
app.layout.sidebar.toggleVisibility(to) app.layout.sidebar.toggleVisibility(to)
} }

View File

@ -80,7 +80,7 @@ export class AudioPlayer extends React.Component {
} }
onClickLikeButton = async () => { onClickLikeButton = async () => {
const result = await PlaylistsModel.toogleTrackLike(this.context.currentManifest._id).catch((err) => { const result = await PlaylistsModel.toggleTrackLike(this.context.currentManifest._id).catch((err) => {
return null return null
}) })

View File

@ -602,7 +602,7 @@ export default class SyncLyrics extends React.Component {
}) })
if (app.layout.sidebar) { if (app.layout.sidebar) {
app.controls.toogleUIVisibility(false) app.controls.toggleUIVisibility(false)
} }
app.cores.style.compactMode(true) app.cores.style.compactMode(true)
@ -643,7 +643,7 @@ export default class SyncLyrics extends React.Component {
delete window._hacks delete window._hacks
if (app.layout.sidebar) { if (app.layout.sidebar) {
app.controls.toogleUIVisibility(true) app.controls.toggleUIVisibility(true)
} }
app.cores.style.compactMode(false) app.cores.style.compactMode(false)

View File

@ -55,7 +55,7 @@ export default (props) => {
} }
const handleTrackLike = async (track) => { const handleTrackLike = async (track) => {
return await PlaylistsModel.toogleTrackLike(track._id) return await PlaylistsModel.toggleTrackLike(track._id)
} }
const makeSearch = (value) => { const makeSearch = (value) => {

View File

@ -29,14 +29,14 @@ export default class FollowsModel {
return response.data return response.data
} }
static toogleFollow = async ({ user_id, username }) => { static toggleFollow = async ({ user_id, username }) => {
if (!user_id && !username) { if (!user_id && !username) {
throw new Error("user_id or username is required") throw new Error("user_id or username is required")
} }
const response = await request({ const response = await request({
method: "POST", method: "POST",
url: "/follow/user/toogle", url: "/follow/user/toggle",
data: { data: {
user_id: user_id, user_id: user_id,
username: username username: username

View File

@ -108,7 +108,7 @@ export default class PlaylistsModel {
return data return data
} }
static toogleTrackLike = async (track_id) => { static toggleTrackLike = async (track_id) => {
if (!track_id) { if (!track_id) {
throw new Error("Track ID is required") throw new Error("Track ID is required")
} }

View File

@ -118,27 +118,27 @@ export default class Post {
return data return data
} }
static toogleLike = async ({ post_id }) => { static toggleLike = async ({ post_id }) => {
if (!post_id) { if (!post_id) {
throw new Error("Post ID is required") throw new Error("Post ID is required")
} }
const { data } = await request({ const { data } = await request({
method: "POST", method: "POST",
url: `/posts/${post_id}/toogle_like`, url: `/posts/${post_id}/toggle_like`,
}) })
return data return data
} }
static toogleSave = async ({ post_id }) => { static toggleSave = async ({ post_id }) => {
if (!post_id) { if (!post_id) {
throw new Error("Post ID is required") throw new Error("Post ID is required")
} }
const { data } = await request({ const { data } = await request({
method: "POST", method: "POST",
url: `/posts/${post_id}/toogle_save`, url: `/posts/${post_id}/toggle_save`,
}) })
return data return data

View File

@ -6,12 +6,13 @@ import unfollowUser from "../services/unfollowUser"
export default { export default {
method: "POST", method: "POST",
route: "/user/toogle", route: "/user/toggle",
middlewares: ["withAuthentication"], middlewares: ["withAuthentication"],
fn: Schematized({ fn: Schematized({
select: ["user_id", "username"], select: ["user_id", "username"],
}, async (req, res) => { }, async (req, res) => {
const selfUserId = req.user._id.toString() const selfUserId = req.user._id.toString()
let targetUserId = null let targetUserId = null
let result = null let result = null

View File

@ -1,5 +1,5 @@
import { Post, } from "@models" import { Post, } from "@models"
import toogleLike from "../../PostsController/services/toogleLike" import toggleLike from "../../PostsController/services/toggleLike"
export default { export default {
method: "POST", method: "POST",
@ -28,7 +28,7 @@ export default {
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {
const mokUserId = `mok_${i}_${count}` const mokUserId = `mok_${i}_${count}`
toogleLike({ toggleLike({
post_id: postData._id.toString(), post_id: postData._id.toString(),
user_id: mokUserId, user_id: mokUserId,
to: true to: true

View File

@ -3,7 +3,7 @@ import { ToogleLike } from "../services"
export default { export default {
method: "POST", method: "POST",
route: "/:post_id/toogle_like", route: "/:post_id/toggle_like",
middlewares: ["withAuthentication"], middlewares: ["withAuthentication"],
fn: Schematized({ fn: Schematized({
select: ["to"], select: ["to"],

View File

@ -2,7 +2,7 @@ import { ToogleSavePost } from "../services"
export default { export default {
method: "POST", method: "POST",
route: "/:post_id/toogle_save", route: "/:post_id/toggle_save",
middlewares: ["withAuthentication"], middlewares: ["withAuthentication"],
fn: async (req, res) => { fn: async (req, res) => {
const post = await ToogleSavePost({ const post = await ToogleSavePost({

View File

@ -1,6 +1,6 @@
export { default as CreatePost } from "./createPost" export { default as CreatePost } from "./createPost"
export { default as ToogleLike } from "./toogleLike" export { default as ToogleLike } from "./toggleLike"
export { default as ToogleSavePost } from "./tooglePostSave" export { default as ToogleSavePost } from "./togglePostSave"
export { default as GetPostData } from "./getPostData" export { default as GetPostData } from "./getPostData"
export { default as DeletePost } from "./deletePost" export { default as DeletePost } from "./deletePost"