mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🔖 fix: URI Encoding for Bookmarks (#4172)
* fix: never defined AcceptTermsMutationOptions * fix: lack of URI encoding in tag mutations
This commit is contained in:
parent
be44caaab1
commit
44458d3832
4 changed files with 14 additions and 4 deletions
|
|
@ -61,7 +61,8 @@ router.post('/', async (req, res) => {
|
||||||
*/
|
*/
|
||||||
router.put('/:tag', async (req, res) => {
|
router.put('/:tag', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const tag = await updateConversationTag(req.user.id, req.params.tag, req.body);
|
const decodedTag = decodeURIComponent(req.params.tag);
|
||||||
|
const tag = await updateConversationTag(req.user.id, decodedTag, req.body);
|
||||||
if (tag) {
|
if (tag) {
|
||||||
res.status(200).json(tag);
|
res.status(200).json(tag);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -81,7 +82,8 @@ router.put('/:tag', async (req, res) => {
|
||||||
*/
|
*/
|
||||||
router.delete('/:tag', async (req, res) => {
|
router.delete('/:tag', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const tag = await deleteConversationTag(req.user.id, req.params.tag);
|
const decodedTag = decodeURIComponent(req.params.tag);
|
||||||
|
const tag = await deleteConversationTag(req.user.id, decodedTag);
|
||||||
if (tag) {
|
if (tag) {
|
||||||
res.status(200).json(tag);
|
res.status(200).json(tag);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -863,7 +863,7 @@ export const useUpdateAssistantMutation = (
|
||||||
const { endpoint } = data;
|
const { endpoint } = data;
|
||||||
const endpointsConfig = queryClient.getQueryData<t.TEndpointsConfig>([QueryKeys.endpoints]);
|
const endpointsConfig = queryClient.getQueryData<t.TEndpointsConfig>([QueryKeys.endpoints]);
|
||||||
const endpointConfig = endpointsConfig?.[endpoint];
|
const endpointConfig = endpointsConfig?.[endpoint];
|
||||||
const version = endpointConfig.version ?? defaultAssistantsVersion[endpoint];
|
const version = endpointConfig?.version ?? defaultAssistantsVersion[endpoint];
|
||||||
return dataService.updateAssistant({
|
return dataService.updateAssistant({
|
||||||
data,
|
data,
|
||||||
version,
|
version,
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,8 @@ export const updatePromptPermissions = (roleName: string) =>
|
||||||
`${roles()}/${roleName.toLowerCase()}/prompts`;
|
`${roles()}/${roleName.toLowerCase()}/prompts`;
|
||||||
|
|
||||||
/* Conversation Tags */
|
/* Conversation Tags */
|
||||||
export const conversationTags = (tag?: string) => `/api/tags${tag ? `/${tag}` : ''}`;
|
export const conversationTags = (tag?: string) =>
|
||||||
|
`/api/tags${tag != null && tag ? `/${encodeURIComponent(tag)}` : ''}`;
|
||||||
|
|
||||||
export const conversationTagsList = (pageNumber: string, sort?: string, order?: string) =>
|
export const conversationTagsList = (pageNumber: string, sort?: string, order?: string) =>
|
||||||
`${conversationTags()}/list?pageNumber=${pageNumber}${sort ? `&sort=${sort}` : ''}${
|
`${conversationTags()}/list?pageNumber=${pageNumber}${sort ? `&sort=${sort}` : ''}${
|
||||||
|
|
|
||||||
|
|
@ -235,3 +235,10 @@ export type UpdateConversationTagOptions = MutationOptions<
|
||||||
types.TConversationTagRequest
|
types.TConversationTagRequest
|
||||||
>;
|
>;
|
||||||
export type DeleteConversationTagOptions = MutationOptions<types.TConversationTag, string>;
|
export type DeleteConversationTagOptions = MutationOptions<types.TConversationTag, string>;
|
||||||
|
|
||||||
|
export type AcceptTermsMutationOptions = MutationOptions<
|
||||||
|
types.TAcceptTermsResponse,
|
||||||
|
void,
|
||||||
|
unknown,
|
||||||
|
void
|
||||||
|
>;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue