mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
chore: refactor services folder
This commit is contained in:
parent
b16daaa780
commit
9ccf99a86f
35 changed files with 41 additions and 41 deletions
|
|
@ -8,7 +8,7 @@ import { getLecture } from "@services/courses/lectures";
|
|||
import AuthProvider from "@components/Security/AuthProvider";
|
||||
import EditorWrapper from "@components/Editor/EditorWrapper";
|
||||
import useSWR, { mutate } from "swr";
|
||||
import { getAPIUrl } from "@services/config";
|
||||
import { getAPIUrl } from "@services/config/config";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
"use client";
|
||||
import { getAPIUrl, getBackendUrl } from "@services/config";
|
||||
import { getAPIUrl, getBackendUrl } from "@services/config/config";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
import React from "react";
|
||||
import { styled } from "styled-components";
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import { Title } from "@components/UI/Elements/Styles/Title";
|
||||
import { createCollection } from "@services/collections";
|
||||
import { createCollection } from "@services/courses/collections";
|
||||
import useSWR from "swr";
|
||||
import { getAPIUrl } from "@services/config";
|
||||
import { getAPIUrl } from "@services/config/config";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
import { getOrganizationContextInfo } from "@services/orgs";
|
||||
import { getOrganizationContextInfo } from "@services/organizations/orgs";
|
||||
|
||||
function NewCollection(params : any) {
|
||||
const orgslug = params.params.orgslug;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import Link from "next/link";
|
|||
import React from "react";
|
||||
import styled from "styled-components";
|
||||
import { Title } from "@components/UI/Elements/Styles/Title";
|
||||
import { deleteCollection } from "@services/collections";
|
||||
import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config";
|
||||
import { deleteCollection } from "@services/courses/collections";
|
||||
import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
import useSWR, { mutate } from "swr";
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { useRouter } from "next/navigation";
|
|||
import NewChapterModal from "@components/Modals/CourseEdit/NewChapter";
|
||||
import NewLectureModal from "@components/Modals/CourseEdit/NewLecture";
|
||||
import { createLecture, createFileLecture } from "@services/courses/lectures";
|
||||
import { getOrganizationContextInfo } from "@services/orgs";
|
||||
import { getOrganizationContextInfo } from "@services/organizations/orgs";
|
||||
|
||||
function CourseEdit(params: any) {
|
||||
const router = useRouter();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import Link from "next/link";
|
|||
import React, { useMemo } from "react";
|
||||
import Layout from "@components/UI/Layout";
|
||||
import { getLecture } from "@services/courses/lectures";
|
||||
import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config";
|
||||
import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config";
|
||||
import Canva from "@components/LectureViews/DynamicCanva/DynamicCanva";
|
||||
import styled from "styled-components";
|
||||
import { getCourse } from "@services/courses/courses";
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { closeActivity, createActivity } from "@services/courses/activity";
|
|||
import Link from "next/link";
|
||||
import React from "react";
|
||||
import styled from "styled-components";
|
||||
import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config";
|
||||
import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config";
|
||||
import useSWR, { mutate } from "swr";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import { Header } from "@components/UI/Header";
|
|||
import Layout from "@components/UI/Layout";
|
||||
import { Title } from "@components/UI/Elements/Styles/Title";
|
||||
import { createNewCourse } from "@services/courses/courses";
|
||||
import { getOrganizationContextInfo } from "@services/orgs";
|
||||
import { getUriWithOrg } from "@services/config";
|
||||
import { getOrganizationContextInfo } from "@services/organizations/orgs";
|
||||
import { getUriWithOrg } from "@services/config/config";
|
||||
|
||||
const NewCoursePage = (params: any) => {
|
||||
const router = useRouter();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useRouter } from "next/navigation";
|
|||
import React from "react";
|
||||
import styled from "styled-components";
|
||||
import { Title } from "@components/UI/Elements/Styles/Title";
|
||||
import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config";
|
||||
import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config";
|
||||
import { deleteCourseFromBackend } from "@services/courses/courses";
|
||||
import useSWR, { mutate } from "swr";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use client";
|
||||
import { Title } from "@components/UI/Elements/Styles/Title";
|
||||
import { getUriWithOrg } from "@services/config";
|
||||
import { getUriWithOrg } from "@services/config/config";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import React from 'react'
|
||||
import useSWR, { mutate } from "swr";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
import { getAPIUrl } from '@services/config';
|
||||
import { getAPIUrl } from '@services/config/config';
|
||||
import { Field, Form, Formik } from 'formik';
|
||||
import { updateOrganization } from '@services/settings/org';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import React from "react";
|
||||
import Layout from "../../../components/UI/Layout";
|
||||
import { Title } from "../../../components/UI/Elements/Styles/Title";
|
||||
import { createNewOrganization } from "../../../services/orgs";
|
||||
import { createNewOrganization } from "../../../services/organizations/orgs";
|
||||
|
||||
const Organizations = () => {
|
||||
const [name, setName] = React.useState("");
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ import Link from "next/link";
|
|||
import React from "react";
|
||||
import Layout from "../../components/UI/Layout";
|
||||
import { Title } from "../../components/UI/Elements/Styles/Title";
|
||||
import { deleteOrganizationFromBackend } from "@services/orgs";
|
||||
import { deleteOrganizationFromBackend } from "@services/organizations/orgs";
|
||||
import useSWR, { mutate } from "swr";
|
||||
import { swrFetcher } from "@services/utils/requests";
|
||||
import { getAPIUrl, getUriWithOrg } from "@services/config";
|
||||
import { getAPIUrl, getUriWithOrg } from "@services/config/config";
|
||||
|
||||
const Organizations = () => {
|
||||
const { data : organizations , error } = useSWR(`${getAPIUrl()}orgs/user/page/1/limit/10`, swrFetcher)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue