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