Merge branch 'staging_environment' into imperial_bushels
This commit is contained in:
commit
c09bd9c6d1
20 changed files with 492 additions and 271 deletions
|
|
@ -290,7 +290,7 @@ export default function BinProvider(props: PropsWithChildren<Props>) {
|
|||
) => {
|
||||
const view = otherTeam ? otherTeam : as
|
||||
let url = "/bins/" + bin + "/updateComponent/" + component + "/preferences";
|
||||
if (view) url = url + "/?as=" + view;
|
||||
if (view) url = url + "?as=" + view;
|
||||
interface request {
|
||||
preferences: Object;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { AxiosResponse } from "axios";
|
||||
import { useHTTP } from "hooks";
|
||||
import { pond } from "protobuf-ts/pond";
|
||||
import { useGlobalState } from "providers";
|
||||
// import { useGlobalState } from "providers";
|
||||
import { createContext, PropsWithChildren, useContext } from "react";
|
||||
import { pondURL } from "./pond";
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ interface Props {}
|
|||
export default function NoteProvider(props: PropsWithChildren<Props>) {
|
||||
const { children } = props;
|
||||
const { get, del, post, put } = useHTTP();
|
||||
const [{as}] = useGlobalState()
|
||||
// const [{as}] = useGlobalState()
|
||||
|
||||
const addNote = (note: pond.NoteSettings, attachments?: string[]) => {
|
||||
let url = pondURL("/notes" + (attachments ? "?attachments=" + attachments.toString() : ""))
|
||||
|
|
@ -88,9 +88,9 @@ export default function NoteProvider(props: PropsWithChildren<Props>) {
|
|||
orderBy?: string,
|
||||
search?: string,
|
||||
asRoot?: boolean,
|
||||
otherTeam?: string
|
||||
// otherTeam?: string
|
||||
) => {
|
||||
const view = otherTeam ? otherTeam : as
|
||||
// const view = otherTeam ? otherTeam : as
|
||||
let url = pondURL(
|
||||
"/notes" +
|
||||
"?limit=" +
|
||||
|
|
@ -100,9 +100,10 @@ export default function NoteProvider(props: PropsWithChildren<Props>) {
|
|||
("&order=" + (order ? order : "asc")) +
|
||||
("&by=" + (orderBy ? orderBy : "key")) +
|
||||
(search ? "&search=" + search : "") +
|
||||
(asRoot ? "&asRoot=" + asRoot.toString() : "") +
|
||||
(view ? "&as=" + view : "")
|
||||
(asRoot ? "&asRoot=" + asRoot.toString() : ""),
|
||||
// (view ? "&as=" + "" : "")
|
||||
)
|
||||
// console.log(url)
|
||||
return new Promise<AxiosResponse<pond.ListNotesResponse>>((resolve, reject) => {
|
||||
get<pond.ListNotesResponse>(url).then(resp => {
|
||||
resp.data = pond.ListNotesResponse.fromObject(resp.data)
|
||||
|
|
@ -119,10 +120,10 @@ export default function NoteProvider(props: PropsWithChildren<Props>) {
|
|||
order?: "asc" | "desc",
|
||||
orderBy?: string,
|
||||
search?: string,
|
||||
asRoot?: boolean,
|
||||
otherTeam?: string
|
||||
// asRoot?: boolean,
|
||||
// otherTeam?: string
|
||||
) => {
|
||||
const view = otherTeam ? otherTeam : as
|
||||
// const view = otherTeam ? otherTeam : as
|
||||
let url = pondURL(
|
||||
"/chats" +
|
||||
"?limit=" +
|
||||
|
|
@ -131,10 +132,11 @@ export default function NoteProvider(props: PropsWithChildren<Props>) {
|
|||
offset +
|
||||
("&order=" + (order ? order : "asc")) +
|
||||
("&by=" + (orderBy ? orderBy : "key")) +
|
||||
(search ? "&search=" + search : "") +
|
||||
(asRoot ? "&asRoot=" + asRoot.toString() : "") +
|
||||
(view ? "&as=" + view : "")
|
||||
(search ? "&search=" + search : ""),
|
||||
// (asRoot ? "&asRoot=" + asRoot.toString() : ""),
|
||||
// (view ? "&as=" + view : "")
|
||||
)
|
||||
// console.log(asRoot)
|
||||
return new Promise<AxiosResponse<pond.ListChatsResponse>>((resolve, reject) => {
|
||||
get<pond.ListChatsResponse>(url).then(resp => {
|
||||
resp.data = pond.ListChatsResponse.fromObject(resp.data)
|
||||
|
|
|
|||
|
|
@ -117,9 +117,11 @@ export default function TeamProvider(props: PropsWithChildren<Props>) {
|
|||
asRoot?: boolean,
|
||||
otherTeam?: string,
|
||||
prefixSearch?: string,
|
||||
useImitation?: boolean,
|
||||
) => {
|
||||
//let asText = team ? "&as=" + team.key() : "";
|
||||
const view = otherTeam ? otherTeam : (as.length > 0 ? as : undefined)
|
||||
let view = otherTeam ? otherTeam : (as.length > 0 ? as : undefined)
|
||||
if (useImitation === undefined || useImitation === false) view = ""
|
||||
let url = pondURL(
|
||||
"/teams" +
|
||||
"?limit=" +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue