Skip to content

Commit

Permalink
Miscellaneous fixes (#450)
Browse files Browse the repository at this point in the history
### Motivation and Context

<!-- Thank you for your contribution to the chat-copilot repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Fix error in chat route
2. Fix error in import document route
3. Add PATCH to CORS allowed methods

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
  • Loading branch information
gitri-ms authored Oct 3, 2023
1 parent c31c2fa commit 738648b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/importdocument/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ async Task UploadAsync(Guid? chatId = null)

string uriPath =
chatId.HasValue ?
$"chat/{chatId}/documents" :
$"chats/{chatId}/documents" :
"documents";

try
Expand Down
2 changes: 1 addition & 1 deletion webapi/Extensions/ServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ internal static IServiceCollection AddCorsPolicy(this IServiceCollection service
policy =>
{
policy.WithOrigins(allowedOrigins)
.WithMethods("POST", "GET", "PUT", "DELETE")
.WithMethods("POST", "GET", "PUT", "DELETE", "PATCH")
.AllowAnyHeader();
});
});
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/libs/services/ChatService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class ChatService extends BaseService {

const result = await this.getResponseAsync<IAskResult>(
{
commandPath: `chats/${chatId}/${processPlan ? 'processPlan' : 'chat'}`,
commandPath: `chats/${chatId}/${processPlan ? 'processPlan' : 'messages'}`,
method: 'POST',
body: ask,
},
Expand Down

0 comments on commit 738648b

Please sign in to comment.