Skip to content

Commit 4676e80

Browse files
author
Jicheng Lu
committed
fix dashboard
1 parent dcbd3b0 commit 4676e80

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

src/lib/services/api-endpoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const endpoints = {
9898

9999
// dashboard
100100
dashboardSettingUrl: `${host}/dashboard/components`,
101-
dashConversationInstructionUrl: `${host}/dashboard/component/conversation?userId={userId}`,
101+
dashConversationInstructionUrl: `${host}/dashboard/component/conversation`,
102102

103103
// Google geocode api
104104
addressUrl: `${host}/address/options`

src/lib/services/conversation-service.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,10 @@ export async function unpinConversationFromDashboard(agentId, conversationId) {
135135

136136
/**
137137
* update a dashboard conversation instuction
138-
* @param {string} userId - The conversation id
139138
* @param {import('$userTypes').DashboardConversation} dashConv - The instruction
140139
*/
141-
export async function updateDashboardConversation(userId, dashConv) {
142-
let url = replaceUrl(endpoints.dashConversationInstructionUrl, {
143-
userId: userId
144-
});
140+
export async function updateDashboardConversation(dashConv) {
141+
let url = endpoints.dashConversationInstructionUrl;
145142
const response = await axios.post(url, dashConv);
146143
return response.data;
147144
}

src/lib/services/dashboard-service.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,10 @@ import axios from 'axios';
33

44
/**
55
* Get dashboard settings
6-
* @param {string} userId - The user id
76
* @returns {Promise<import('$userTypes').DashboardModel>}
87
*/
9-
export async function getDashboardSettings(userId) {
10-
let userIdParam = userId;
11-
let url = endpoints.dashboardSettingUrl;
12-
console.log(url);
13-
const response = await axios.get(url, {
14-
params: {
15-
"userId" : userId
16-
}
17-
});
8+
export async function getDashboardSettings() {
9+
const url = endpoints.dashboardSettingUrl;
10+
const response = await axios.get(url);
1811
return response.data;
1912
}

src/routes/page/dashboard/+page.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@
5454
})
5555
5656
/**
57-
* delete a message in conversation
5857
* @param {string} userId The user input
5958
*/
6059
async function loadDashboardComponents(userId) {
61-
getDashboardSettings(userId)
60+
getDashboardSettings()
6261
.then(
6362
response => {
6463
dashboard_model = response

src/routes/page/dashboard/Conversation.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
let loadUtils;
3232
3333
/** @type {number} */
34-
let messageInputTimeout;
34+
let messageInputTimeout = 0;
3535
3636
/** @type {string[]} */
3737
let chatUtilOptions = [];
@@ -136,7 +136,7 @@
136136
type="submit"
137137
class={`btn btn-rounded chat-send waves-effect waves-light btn-primary`}
138138
disabled={!!!(text)}
139-
on:click={() => updateDashboardConversation(userId, {
139+
on:click={() => updateDashboardConversation({
140140
conversation_id: conversationId,
141141
name: '',
142142
instruction: text

0 commit comments

Comments
 (0)