Skip to content

Commit 9b7e4b1

Browse files
committed
fix: Discord Agent
1 parent 0eb96e3 commit 9b7e4b1

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

apps/server/src/World.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ export class World {
220220

221221
async addAgent(obj: any) {
222222
const data = {...obj.data, id: obj.id, enabled: obj.enabled, dirty: obj.dirty, spells: obj.spells, updated_at: obj.updated_at}
223+
console.log("SERVER", data.id)
223224
if (this.objects[data.id] === undefined) {
225+
data.projectId = projectId
224226
this.objects[data.id] = new Agent(data)
225227
} else {
226228
throw new ServerError('already-exists', 'Object already exists')

packages/editor/src/workspaces/agents/Agent.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,16 @@ const AgentWindow = ({
6969

7070
useEffect(() => {
7171
;(async () => {
72-
const res = await axios.get(`${config.apiUrl}/spells`)
72+
const params = {
73+
projectId : config.projectId
74+
};
75+
var res
76+
try {
77+
res = await axios.get(`${config.apiUrl}/spells`,{params})
78+
} catch(error) {
79+
console.log("ERROR: ", error)
80+
}
81+
7382
console.log('res', res.data)
7483
console.log('spellList', res.data)
7584
setSpellList(res.data?.data)

0 commit comments

Comments
 (0)