forked from arayabrain/barebone-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from arayabrain/feature/check_role
Add Permission Role
- Loading branch information
Showing
32 changed files
with
823 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const enum ROLE { | ||
ADMIN = 1, | ||
MANAGER = 10, | ||
OPERATOR = 20, | ||
GUEST_OPERATOR = 30 | ||
} | ||
|
||
export const enum SHARE { | ||
NOSHARE = 0, | ||
ORGANIZATION = 2, | ||
USERS = 1, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,42 @@ | ||
import { DatabaseParams } from 'store/slice/Database/DatabaseType' | ||
import { DatabaseDTO, DatabaseParams, ListShareDTO } from 'store/slice/Database/DatabaseType' | ||
import axios from 'utils/axios' | ||
import qs from 'qs' | ||
|
||
export const getExperimentsPublicApi = async (params: DatabaseParams) => { | ||
export const getExperimentsPublicApi = async (params: DatabaseParams): Promise<DatabaseDTO> => { | ||
const paramsNew = qs.stringify(params, { indices: false }) | ||
const response = await axios.get(`/public/experiments?${paramsNew}`) | ||
return response.data | ||
} | ||
|
||
export const getCellsPublicApi = async (params: DatabaseParams) => { | ||
export const getCellsPublicApi = async (params: DatabaseParams): Promise<DatabaseDTO> => { | ||
const paramsNew = qs.stringify(params, { indices: false }) | ||
const response = await axios.get(`/public/cells?${paramsNew}`) | ||
return response.data | ||
} | ||
|
||
export const getExperimentsApi = async (params: DatabaseParams) => { | ||
export const getExperimentsApi = async (params: DatabaseParams): Promise<DatabaseDTO> => { | ||
const paramsNew = qs.stringify(params, { indices: false }) | ||
const response = await axios.get(`/expdb/experiments?${paramsNew}`) | ||
return response.data | ||
} | ||
|
||
export const getCellsApi = async (params: DatabaseParams) => { | ||
export const getCellsApi = async (params: DatabaseParams): Promise<DatabaseDTO> => { | ||
const paramsNew = qs.stringify(params, { indices: false }) | ||
const response = await axios.get(`/expdb/cells?${paramsNew}`) | ||
return response.data | ||
} | ||
|
||
export const postPublistApi = async (id: number, status: 'on' | 'off') => { | ||
export const postPublistApi = async (id: number, status: 'on' | 'off'): Promise<boolean> => { | ||
const response = await axios.post(`/expdb/experiment/publish/${id}/${status}`) | ||
return response.data | ||
} | ||
|
||
export const getListUserShareApi = async (id: number): Promise<ListShareDTO> => { | ||
const response = await axios.get(`/expdb/share/${id}/status`) | ||
return response.data | ||
} | ||
|
||
export const postListUserShareApi = async (id: number, data: {share_type: number; user_ids: number[]}): Promise<boolean> => { | ||
const response = await axios.post(`/expdb/share/${id}/status`, data) | ||
return response.data | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.