mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-13 08:12:32 +10:00
fix initial setup
This commit is contained in:
@ -3,7 +3,7 @@ import Cookies from "js-cookie";
|
|||||||
import Routes from "@/lib/routes";
|
import Routes from "@/lib/routes";
|
||||||
|
|
||||||
const api: AxiosInstance = axios.create({
|
const api: AxiosInstance = axios.create({
|
||||||
baseURL: import.meta.env.VITE_BACKEND_API_URL + "/api",
|
baseURL: import.meta.env.VITE_BACKEND_API_URL ?? "" + "/api",
|
||||||
});
|
});
|
||||||
|
|
||||||
api.interceptors.request.use(
|
api.interceptors.request.use(
|
||||||
|
|||||||
@ -9,13 +9,13 @@ import { SpaceService } from '../../space/services/space.service';
|
|||||||
import { CreateSpaceDto } from '../../space/dto/create-space.dto';
|
import { CreateSpaceDto } from '../../space/dto/create-space.dto';
|
||||||
import { SpaceRole, UserRole } from '../../../helpers/types/permission';
|
import { SpaceRole, UserRole } from '../../../helpers/types/permission';
|
||||||
import { GroupService } from '../../group/services/group.service';
|
import { GroupService } from '../../group/services/group.service';
|
||||||
import { GroupUserService } from '../../group/services/group-user.service';
|
|
||||||
import { SpaceMemberService } from '../../space/services/space-member.service';
|
import { SpaceMemberService } from '../../space/services/space-member.service';
|
||||||
import { WorkspaceRepo } from '@docmost/db/repos/workspace/workspace.repo';
|
import { WorkspaceRepo } from '@docmost/db/repos/workspace/workspace.repo';
|
||||||
import { KyselyDB, KyselyTransaction } from '@docmost/db/types/kysely.types';
|
import { KyselyDB, KyselyTransaction } from '@docmost/db/types/kysely.types';
|
||||||
import { executeTx } from '@docmost/db/utils';
|
import { executeTx } from '@docmost/db/utils';
|
||||||
import { InjectKysely } from 'nestjs-kysely';
|
import { InjectKysely } from 'nestjs-kysely';
|
||||||
import { User } from '@docmost/db/types/entity.types';
|
import { User } from '@docmost/db/types/entity.types';
|
||||||
|
import { GroupUserRepo } from '@docmost/db/repos/group/group-user.repo';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class WorkspaceService {
|
export class WorkspaceService {
|
||||||
@ -24,7 +24,7 @@ export class WorkspaceService {
|
|||||||
private spaceService: SpaceService,
|
private spaceService: SpaceService,
|
||||||
private spaceMemberService: SpaceMemberService,
|
private spaceMemberService: SpaceMemberService,
|
||||||
private groupService: GroupService,
|
private groupService: GroupService,
|
||||||
private groupUserService: GroupUserService,
|
private groupUserRepo: GroupUserRepo,
|
||||||
@InjectKysely() private readonly db: KyselyDB,
|
@InjectKysely() private readonly db: KyselyDB,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@ -77,10 +77,11 @@ export class WorkspaceService {
|
|||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
// add user to default group created above
|
// add user to default group created above
|
||||||
await this.groupUserService.addUserToGroup(
|
await this.groupUserRepo.insertGroupUser(
|
||||||
user.id,
|
{
|
||||||
group.id,
|
userId: user.id,
|
||||||
workspace.id,
|
groupId: group.id,
|
||||||
|
},
|
||||||
trx,
|
trx,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user