fix: proper implementation of isCustomMethod

This commit is contained in:
Andrew Bastin
2021-08-08 13:16:14 +05:30
parent c97f8aa148
commit 846c1426cf

View File

@@ -28,7 +28,7 @@
focus:border-accent focus:outline-none focus:border-accent focus:outline-none
" "
:value="newMethod" :value="newMethod"
:readonly="isCustomMethod()" :readonly="!isCustomMethod"
@input="onSelectMethod($event.target.value)" @input="onSelectMethod($event.target.value)"
/> />
</template> </template>
@@ -205,6 +205,7 @@
<script lang="ts"> <script lang="ts">
import { import {
computed,
defineComponent, defineComponent,
ref, ref,
useContext, useContext,
@@ -383,11 +384,9 @@ export default defineComponent({
defineActionHandler("request.method.delete", () => updateMethod("DELETE")) defineActionHandler("request.method.delete", () => updateMethod("DELETE"))
defineActionHandler("request.method.head", () => updateMethod("HEAD")) defineActionHandler("request.method.head", () => updateMethod("HEAD"))
const isCustomMethod = () => { const isCustomMethod = computed(() => {
if (newMethod.value === "CUSTOM" || !methods.includes(newMethod.value)) return newMethod.value === "CUSTOM" || !methods.includes(newMethod.value)
return false })
return true
}
return { return {
newEndpoint, newEndpoint,