mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
fix: Add OAuth support to search query source enum (#9511)
- Add 'oauth' to SearchQuery enum in server and client models - Add database migration to include 'oauth' in enum_search_queries_source - Fixes 400 validation error when OAuth users search with parameters 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ class SearchQuery extends Model {
|
||||
/**
|
||||
* Where the query originated.
|
||||
*/
|
||||
source: "api" | "app" | "slack";
|
||||
source: "api" | "app" | "slack" | "oauth";
|
||||
|
||||
delete = async () => {
|
||||
this.isSaving = true;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
/** @type {import('sequelize-cli').Migration} */
|
||||
module.exports = {
|
||||
async up (queryInterface, Sequelize) {
|
||||
await queryInterface.sequelize.query(
|
||||
"ALTER TYPE enum_search_queries_source ADD VALUE 'oauth'"
|
||||
);
|
||||
},
|
||||
|
||||
async down (queryInterface, Sequelize) {
|
||||
// Note: PostgreSQL doesn't support removing enum values easily
|
||||
// This would require recreating the enum type and updating all references
|
||||
throw new Error('Cannot rollback adding enum value to PostgreSQL');
|
||||
}
|
||||
};
|
||||
@@ -38,7 +38,7 @@ class SearchQuery extends Model<
|
||||
/**
|
||||
* Where the query originated.
|
||||
*/
|
||||
@Column(DataType.ENUM("slack", "app", "api"))
|
||||
@Column(DataType.ENUM("slack", "app", "api", "oauth"))
|
||||
source: string;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user