Repository navigation
管理者画面から特別シフト申請を削除できない不具合を修正 - #77
Merged
Merged
Conversation
管理者のシフト一覧カレンダー・全シフト一覧テーブル・シフト詳細モーダルで 特別シフト申請を削除しても、実際には削除されないまま「削除しました」と 表示されていた。特別シフト申請の UUID を通常シフト用の削除 API (deleteMultipleShifts / deleteShift)に送っていたため、shifts テーブルに 該当行がなく 0 件削除で成功扱いになっていた。 チェックボックスや削除ボタンに data-type(special / regular)を持たせ、 特別シフト申請は cancelSpecialShiftApplication でキャンセルするようにした。 UUID の振り分けと種類別の削除は、自分のシフト一覧にあった処理を collectUuidsByType() / deleteShiftsByType() として shifts.js に切り出し、 各画面で共有している。全シフト一覧テーブルのチェックボックスの属性は data-shift-uuid から data-uuids に変更した。 テストは実コードを直接 import して検証している (docs/refactoring/phase-1-test-foundation.md の方針)。 テスト: 430 passed (33 suites) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
管理者画面で特別シフト申請を削除しても、実際には削除されないまま「削除しました」と表示される不具合を修正します。
原因
特別シフト申請の UUID を通常シフト用の削除 API(
deleteMultipleShifts/deleteShift)に送っていました。特別シフト申請はshiftsテーブルにないため 0 件削除となり、それでも API は成功を返すので、画面上は削除できたように見えていました。変更内容
calendar.js)allShiftsTable.js)shifts.jsのdeleteShiftFromModal)data-type(special/regular)を持たせ、特別シフト申請はcancelSpecialShiftApplicationでキャンセルするようにしました。collectUuidsByType()/deleteShiftsByType()としてshifts.jsに切り出し、各画面で共有しています。data-shift-uuidからdata-uuidsに変更しました。テスト
test/admin-special-shift-delete.test.jsを追加しました。エクスポートガード経由で実コードを直接 import して検証しています(docs/refactoring/phase-1-test-foundation.mdの方針)。npm test: 430 passed(33 suites)補足
test/bulk-delete.test.jsの 173〜182 行目には、全シフト一覧テーブルの旧い UUID 取り出し処理(data-shift-uuid)がインラインコピーとして残っています。コピーなのでテストは通りますが、実コードとは一致しなくなっています。この PR では手を入れていません。🤖 Generated with Claude Code